| 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);
|
| +})();
|
|
|