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

Unified Diff: test/cctest/test-parsing.cc

Issue 1752753002: Fix bug with multiple directives in the preparser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 months 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 | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index b04fb94d3ac92801f23ef9b44ecade040319e1a8..402e4b039aeb60510379b6f568eb96321c0657fa 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6029,6 +6029,31 @@ TEST(LanguageModeDirectives) {
}
+TEST(MultipleLanguageModeDirectives) {
+ const char* context_data[][2] = {
+ { "'use strict'; 'use strong';", "" },
+ { "'use strong'; 'use strict';", "" },
+ { "function f() { 'use strict'; 'use strong';", "}" },
+ { "function f() { 'use strong'; 'use strict';", "}" },
+ { NULL, NULL }
+ };
+
+ const char* strict_error_data[] = {
+ "var x = 42; delete x",
+ NULL};
+
+ const char* strong_error_data[] = {
+ "var x = 42",
+ NULL};
+
+ static const ParserFlag strong_mode_flags[] = {kAllowStrongMode};
+ RunParserSyncTest(context_data, strict_error_data, kError,
+ strong_mode_flags, arraysize(strong_mode_flags));
+ RunParserSyncTest(context_data, strong_error_data, kError, NULL, 0,
+ strong_mode_flags, arraysize(strong_mode_flags));
+}
+
+
TEST(PropertyNameEvalArguments) {
const char* context_data[][2] = {{"'use strict';", ""},
{"'use strong';", ""},
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698