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

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

Issue 996223003: [es6] support template literals after MemberExpression (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Delete meaningless edit Created 5 years, 9 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
« src/scanner.h ('K') | « src/scanner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/templates.js
diff --git a/test/mjsunit/harmony/templates.js b/test/mjsunit/harmony/templates.js
index a884f58fb657b31d2cce4e51dd39e7ed831dd73c..6b89973c5f773d3a24317349b862c931f031e49a 100644
--- a/test/mjsunit/harmony/templates.js
+++ b/test/mjsunit/harmony/templates.js
@@ -423,10 +423,12 @@ var obj = {
Object.defineProperty(Array.prototype, 0, {
set: function() {
assertUnreachable();
- }
+ },
+ configurable: true
});
function tag(){}
tag`a${1}b`;
+ delete Array.prototype[0];
})();
@@ -518,3 +520,41 @@ var obj = {
assertThrows("`${(function() { \"use strict\"; return \"\\07\"; })()}`",
SyntaxError);
})();
+
+
+var global = this;
+(function testCallNew() {
+ "use strict";
+ var called = false;
+ var calledWith;
+ global.log = function(x) { called = true; calledWith = x; }
+
+ assertInstanceof(new(Function`log("test")`), Object);
+ assertTrue(called);
+ assertSame("test", calledWith);
+ delete global.log;
+})();
+
+
+(function testCallResultOfTagFn() {
+ "use strict";
+ var i = 0;
+ var raw = [];
+ function tag(cs) {
+ var args = Array.prototype.slice.call(arguments);
+ var text = String.raw.apply(null, args);
+ if (i++ < 2) {
+ raw.push("tag;" + text);
+ return tag;
+ }
+
+ raw.push("raw;" + text);
+ return text;
+ }
+ assertEquals("test3", tag`test1``test2``test3`);
+ assertEquals([
+ "tag;test1",
+ "tag;test2",
+ "raw;test3"
+ ], raw);
+})();
« src/scanner.h ('K') | « src/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698