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

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

Issue 964063003: Fix test for function declarations syntax error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 9 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/preparser.cc ('k') | test/mjsunit/es6/block-let-declaration.js » ('j') | 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 e8ec59942c903509504c00bafd4babc1e6f0f65f..2bd3a699d518d00a83198484c02acd93c914d94a 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -2957,6 +2957,36 @@ TEST(StrictDelete) {
}
+TEST(NoErrorsDeclsInCase) {
+ const char* context_data[][2] = {
+ {"'use strict'; switch(x) { case 1:", "}"},
+ {"function foo() {'use strict'; switch(x) { case 1:", "}}"},
+ {"'use strict'; switch(x) { case 1: case 2:", "}"},
+ {"function foo() {'use strict'; switch(x) { case 1: case 2:", "}}"},
+ {"'use strict'; switch(x) { default:", "}"},
+ {"function foo() {'use strict'; switch(x) { default:", "}}"},
+ {"'use strict'; switch(x) { case 1: default:", "}"},
+ {"function foo() {'use strict'; switch(x) { case 1: default:", "}}"},
+ { nullptr, nullptr }
+ };
+
+ const char* statement_data[] = {
+ "function f() { }",
+ "class C { }",
+ "class C extends Q {}",
+ "function f() { } class C {}",
+ "function f() { }; class C {}",
+ "class C {}; function f() {}",
+ nullptr
+ };
+
+ static const ParserFlag always_flags[] = {kAllowHarmonyClasses};
+
+ RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0,
+ always_flags, arraysize(always_flags));
+}
+
+
TEST(InvalidLeftHandSide) {
const char* assignment_context_data[][2] = {
{"", " = 1;"},
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/es6/block-let-declaration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698