Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 235d3e3b1b53ec8c9f78ff02caf47a873d69f740..484d2f32264643d36cb29130e0e3259061185f06 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -23959,6 +23959,24 @@ TEST(StreamingScriptConstantArray) { |
RunStreamingTest(chunks); |
} |
+TEST(StreamingScriptEvalShadowing) { |
+ // When run with Ignition, tests that the streaming parser canonicalizes |
+ // handles so the Variable::is_possibly_eval() is correct. |
+ const char* chunk1 = |
+ "(function() {\n" |
+ " var y = 2;\n" |
+ " return (function() {\n" |
+ " eval('var y = 13;');\n" |
+ " function g() {\n" |
+ " return y\n" |
+ " }\n" |
+ " return g();\n" |
+ " })()\n" |
+ "})()\n"; |
+ const char* chunks[] = {chunk1, NULL}; |
+ RunStreamingTest(chunks); |
+} |
+ |
TEST(StreamingBiggerScript) { |
const char* chunk1 = |
"function foo() {\n" |