Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6573,6 +6573,12 @@ def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, err
r"static_assert|COMPILE_ASSERT"
r")\s*\("
)

# V8 Fast API types require non-const references as part of their API
# contract; Node.js has no control over these signatures.
_V8_FAST_API_REF_TYPES = re.compile(
r"v8::FastApiCallbackOptions\s*&"
)
if re.search(allowed_functions, line):
return
if not re.search(r"\S+\([^)]*$", line):
Expand All @@ -6587,7 +6593,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, err
for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls):
if not re.match(_RE_PATTERN_CONST_REF_PARAM, parameter) and not re.match(
_RE_PATTERN_REF_STREAM_PARAM, parameter
):
) and not _V8_FAST_API_REF_TYPES.search(parameter):
error(
filename,
linenum,
Expand Down
Loading