Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index e1fe1930928b094f8893bc06404c9ea4db7e8a99..d0a516a7df4f8e5b2e60f6dead67905314e2c721 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -5869,13 +5869,48 @@ TEST(StrongUndefinedLocal) { |
"(class undefined {'use strong'});", |
NULL}; |
- static const ParserFlag always_flags[] = {kAllowStrongMode}; |
+ static const ParserFlag always_flags[] = { |
+ kAllowStrongMode, kAllowHarmonySloppy |
+ }; |
RunParserSyncTest(context_data, data, kError, NULL, 0, |
always_flags, arraysize(always_flags)); |
} |
+TEST(StrongUndefinedArrow) { |
+ 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[] = { |
+ "(undefined => {return});", |
+ "((undefined, b, c) => {return});", |
+ "((a, undefined, c) => {return});", |
+ "((a, b, undefined) => {return});", |
+ NULL}; |
+ |
+ const char* local_strong[] = { |
+ "(undefined => {'use strong';});", |
+ "((undefined, b, c) => {'use strong';});", |
+ "((a, undefined, c) => {'use strong';});", |
+ "((a, b, undefined) => {'use strong';});", |
+ NULL}; |
+ |
+ static const ParserFlag always_flags[] = { |
+ kAllowStrongMode, kAllowHarmonyArrowFunctions |
+ }; |
+ RunParserSyncTest(sloppy_context_data, data, kSuccess, 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, |
+ arraysize(always_flags)); |
+ RunParserSyncTest(sloppy_context_data, local_strong, kError, NULL, 0, |
+ always_flags, arraysize(always_flags)); |
+} |
+ |
+ |
TEST(ArrowFunctionASIErrors) { |
const char* context_data[][2] = {{"'use strict';", ""}, {"", ""}, |
{NULL, NULL}}; |