summaryrefslogtreecommitdiff
path: root/deps/v8/PRESUBMIT.py
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-03-12 09:01:49 +0100
committerMichaël Zasso <targos@protonmail.com>2019-03-14 18:49:21 +0100
commit7b48713334469818661fe276cf571de9c7899f2d (patch)
tree4dbda49ac88db76ce09dc330a0cb587e68e139ba /deps/v8/PRESUBMIT.py
parent8549ac09b256666cf5275224ec58fab9939ff32e (diff)
downloadandroid-node-v8-7b48713334469818661fe276cf571de9c7899f2d.tar.gz
android-node-v8-7b48713334469818661fe276cf571de9c7899f2d.tar.bz2
android-node-v8-7b48713334469818661fe276cf571de9c7899f2d.zip
deps: update V8 to 7.3.492.25
PR-URL: https://github.com/nodejs/node/pull/25852 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/PRESUBMIT.py')
-rw-r--r--deps/v8/PRESUBMIT.py73
1 files changed, 55 insertions, 18 deletions
diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py
index e48d51d8e5..8aea920ef4 100644
--- a/deps/v8/PRESUBMIT.py
+++ b/deps/v8/PRESUBMIT.py
@@ -77,7 +77,7 @@ def _V8PresubmitChecks(input_api, output_api):
sys.path.append(input_api.os_path.join(
input_api.PresubmitLocalPath(), 'tools'))
from v8_presubmit import CppLintProcessor
- from v8_presubmit import TorqueFormatProcessor
+ from v8_presubmit import TorqueLintProcessor
from v8_presubmit import SourceProcessor
from v8_presubmit import StatusFilesProcessor
@@ -96,7 +96,7 @@ def _V8PresubmitChecks(input_api, output_api):
if not CppLintProcessor().RunOnFiles(
input_api.AffectedFiles(file_filter=FilterFile, include_deletes=False)):
results.append(output_api.PresubmitError("C++ lint check failed"))
- if not TorqueFormatProcessor().RunOnFiles(
+ if not TorqueLintProcessor().RunOnFiles(
input_api.AffectedFiles(file_filter=FilterTorqueFile,
include_deletes=False)):
results.append(output_api.PresubmitError("Torque format check failed"))
@@ -330,6 +330,7 @@ def _CommonChecks(input_api, output_api):
_CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api))
results.extend(_CheckJSONFiles(input_api, output_api))
results.extend(_CheckMacroUndefs(input_api, output_api))
+ results.extend(_CheckNoexceptAnnotations(input_api, output_api))
results.extend(input_api.RunTests(
input_api.canned_checks.CheckVPythonSpec(input_api, output_api)))
return results
@@ -450,6 +451,58 @@ def _CheckMacroUndefs(input_api, output_api):
return []
+def _CheckNoexceptAnnotations(input_api, output_api):
+ """
+ Checks that all user-defined constructors and assignment operators are marked
+ V8_NOEXCEPT.
+
+ This is required for standard containers to pick the right constructors. Our
+ macros (like MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS) add this automatically.
+ Omitting it at some places can result in weird compiler errors if this is
+ mixed with other classes that have the annotation.
+
+ TODO(clemensh): This check should eventually be enabled for all files via
+ tools/presubmit.py (https://crbug.com/v8/8616).
+ """
+
+ def FilterFile(affected_file):
+ return input_api.FilterSourceFile(
+ affected_file,
+ white_list=(r'src/.*', r'test/.*'))
+
+
+ # matches any class name.
+ class_name = r'\b([A-Z][A-Za-z0-9_:]*)(?:::\1)?'
+ # initial class name is potentially followed by this to declare an assignment
+ # operator.
+ potential_assignment = r'(?:&\s+(?:\1::)?operator=)?\s*'
+ # matches an argument list that contains only a reference to a class named
+ # like the first capture group, potentially const.
+ single_class_ref_arg = r'\(\s*(?:const\s+)?\1(?:::\1)?&&?[^,;)]*\)'
+ # matches anything but a sequence of whitespaces followed by either
+ # V8_NOEXCEPT or "= delete".
+ not_followed_by_noexcept = r'(?!\s+(?:V8_NOEXCEPT|=\s+delete)\b)'
+ full_pattern = r'^.*?' + class_name + potential_assignment + \
+ single_class_ref_arg + not_followed_by_noexcept + '.*?$'
+ regexp = input_api.re.compile(full_pattern, re.MULTILINE)
+
+ errors = []
+ for f in input_api.AffectedFiles(file_filter=FilterFile,
+ include_deletes=False):
+ with open(f.LocalPath()) as fh:
+ for match in re.finditer(regexp, fh.read()):
+ errors.append('in {}: {}'.format(f.LocalPath(),
+ match.group().strip()))
+
+ if errors:
+ return [output_api.PresubmitPromptOrNotify(
+ 'Copy constructors, move constructors, copy assignment operators and '
+ 'move assignment operators should be marked V8_NOEXCEPT.\n'
+ 'Please report false positives on https://crbug.com/v8/8616.',
+ errors)]
+ return []
+
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
@@ -466,19 +519,3 @@ def CheckChangeOnCommit(input_api, output_api):
input_api, output_api,
json_url='http://v8-status.appspot.com/current?format=json'))
return results
-
-def PostUploadHook(cl, change, output_api):
- """git cl upload will call this hook after the issue is created/modified.
-
- This hook adds a noi18n bot if the patch affects Intl.
- """
- def affects_intl(f):
- return 'intl' in f.LocalPath() or 'test262' in f.LocalPath()
- if not change.AffectedFiles(file_filter=affects_intl):
- return []
- return output_api.EnsureCQIncludeTrybotsAreAdded(
- cl,
- [
- 'luci.v8.try:v8_linux_noi18n_rel_ng'
- ],
- 'Automatically added noi18n trybots to run tests on CQ.')