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

Unified Diff: test/mjsunit/es6/templates.js

Issue 1580463003: Stop treating scopes containing template strings tagged with 'eval' specially (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/templates.js
diff --git a/test/mjsunit/es6/templates.js b/test/mjsunit/es6/templates.js
index 621b06074eeaf7c838c09057fea935484a175fe0..3c4584d33799a7cacb545c942ebbfac8f2d1a648 100644
--- a/test/mjsunit/es6/templates.js
+++ b/test/mjsunit/es6/templates.js
@@ -697,3 +697,22 @@ var global = this;
assertArrayEquals(["get0"], log);
assertArrayEquals([1], tagged);
})();
+
+
+// Since the first argument to the tag function is always an array,
+// eval calls will always just return that array.
+(function testEvalTagStrict() {
+ "use strict";
+ var f = (x) => eval`a${x}b`;
+ var result = f();
+ assertEquals(["a", "b"], result);
+ assertSame(result, f());
+})();
+
+
+(function testEvalTagSloppy() {
+ var f = (x) => eval`a${x}b`;
+ var result = f();
+ assertEquals(["a", "b"], result);
+ assertSame(result, f());
+})();
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698