Skip to content

Commit 80e8144

Browse files
committed
tools: fix cpplint false positive for v8::FastApiCallbackOptions&
1 parent bf1aebc commit 80e8144

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/cpplint.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6573,6 +6573,12 @@ def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, err
65736573
r"static_assert|COMPILE_ASSERT"
65746574
r")\s*\("
65756575
)
6576+
6577+
# V8 Fast API types require non-const references as part of their API
6578+
# contract; Node.js has no control over these signatures.
6579+
_V8_FAST_API_REF_TYPES = re.compile(
6580+
r"v8::FastApiCallbackOptions\s*&"
6581+
)
65766582
if re.search(allowed_functions, line):
65776583
return
65786584
if not re.search(r"\S+\([^)]*$", line):
@@ -6587,7 +6593,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, err
65876593
for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls):
65886594
if not re.match(_RE_PATTERN_CONST_REF_PARAM, parameter) and not re.match(
65896595
_RE_PATTERN_REF_STREAM_PARAM, parameter
6590-
):
6596+
) and not _V8_FAST_API_REF_TYPES.search(parameter):
65916597
error(
65926598
filename,
65936599
linenum,

0 commit comments

Comments
 (0)