Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index dd328359a1c28b94724904f7aa061ce6392ffb35..2e5019fd13b6e8469ace2e37c5182c6f6bf42aaa 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -5608,6 +5608,32 @@ TEST(StrongSuperCalls) { |
} |
+TEST(StrongConstructorReturns) { |
+ const char* sloppy_context_data[][2] = {{"", ""}, {NULL}}; |
+ const char* strict_context_data[][2] = {{"'use strict';", ""}, {NULL}}; |
+ const char* strong_context_data[][2] = {{"'use strong';", ""}, {NULL}}; |
+ |
+ const char* data[] = { |
+ "class C extends Object { constructor() { super(); return {}; } }", |
+ "class C extends Object { constructor() { super(); { return {}; } } }", |
+ "class C extends Object { constructor() { super(); if (1) return {}; } }", |
+ "class C extends Object { constructor() { return; super(); } }", |
+ "class C extends Object { constructor() { { return; } super(); } }", |
+ "class C extends Object { constructor() { if (0) return; super(); } }", |
+ NULL}; |
+ |
+ static const ParserFlag always_flags[] = { |
+ kAllowStrongMode, kAllowHarmonyClasses, kAllowHarmonyObjectLiterals |
+ }; |
+ RunParserSyncTest(sloppy_context_data, data, kError, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+ RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+ RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, |
Dmitry Lomov (no reviews)
2015/03/19 13:59:41
Please add positive tests for strong mode:
'const
rossberg
2015/03/19 16:02:57
We don't have any 'positive' strong mode tests at
|
+ arraysize(always_flags)); |
+} |
+ |
+ |
TEST(ArrowFunctionASIErrors) { |
const char* context_data[][2] = {{"'use strict';", ""}, {"", ""}, |
{NULL, NULL}}; |