Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index d0a516a7df4f8e5b2e60f6dead67905314e2c721..a0a39e563b126de96efc4b64aacc7c0566c8687d 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -5911,6 +5911,36 @@ TEST(StrongUndefinedArrow) { |
} |
+TEST(StrongDirectEval) { |
+ const char* context_data[][2] = {{"", ""}, {NULL}}; |
+ |
+ const char* error_data[] = { |
+ "'use strong'; eval();", |
+ "'use strong'; eval([]);", |
+ "'use strong'; (eval)();", |
+ "'use strong'; (((eval)))();", |
+ "'use strong'; eval('function f() {}');", |
+ "'use strong'; function f() {eval()}", |
marja
2015/04/13 19:13:07
For this kind of a test, it would be useful to put
|
+ NULL}; |
+ |
+ const char* success_data[] = { |
+ "'use strong'; eval;", |
+ "'use strong'; eval`foo`;", |
+ "'use strong'; let foo = eval; foo();", |
+ "'use strong'; (1, eval)();", |
+ NULL}; |
+ |
+ static const ParserFlag always_flags[] = { |
+ kAllowStrongMode |
+ }; |
+ |
+ RunParserSyncTest(context_data, error_data, kError, NULL, 0, |
+ always_flags, arraysize(always_flags)); |
+ RunParserSyncTest(context_data, success_data, kSuccess, NULL, 0, |
+ always_flags, arraysize(always_flags)); |
+} |
+ |
+ |
TEST(ArrowFunctionASIErrors) { |
const char* context_data[][2] = {{"'use strict';", ""}, {"", ""}, |
{NULL, NULL}}; |