Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: test/preparser/testcfg.py

Issue 784323002: Pass --noharmony-scoping to tests validating that we throw on 'const' in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/preparser/strict-const.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/preparser/testcfg.py
diff --git a/test/preparser/testcfg.py b/test/preparser/testcfg.py
index 850c0a45898591dfc4017fd8bf6defbc0b61f12f..82b011df19527060ea7cca2ab02c0bdd911ab6e3 100644
--- a/test/preparser/testcfg.py
+++ b/test/preparser/testcfg.py
@@ -34,6 +34,10 @@ from testrunner.local import utils
from testrunner.objects import testcase
+FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
+INVALID_FLAGS = ["--enable-slow-asserts"]
+
+
class PreparserTestSuite(testsuite.TestSuite):
def __init__(self, name, root):
super(PreparserTestSuite, self).__init__(name, root)
@@ -104,6 +108,15 @@ class PreparserTestSuite(testsuite.TestSuite):
first = testcase.flags[0]
if first != "-e":
testcase.flags[0] = os.path.join(self.root, first)
+ source = self.GetSourceForTest(testcase)
+ result = []
+ flags_match = re.findall(FLAGS_PATTERN, source)
+ for match in flags_match:
+ result += match.strip().split()
+ result += context.mode_flags
+ result = [x for x in result if x not in INVALID_FLAGS]
+ result.append(os.path.join(self.root, testcase.path + ".js"))
+ return testcase.flags + result
return testcase.flags
def GetSourceForTest(self, testcase):
« no previous file with comments | « test/preparser/strict-const.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698