OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-templates | 5 // Flags: --harmony-templates --harmony-strings |
6 | 6 |
7 var num = 5; | 7 var num = 5; |
8 var str = "str"; | 8 var str = "str"; |
9 function fn() { return "result"; } | 9 function fn() { return "result"; } |
10 var obj = { | 10 var obj = { |
11 num: num, | 11 num: num, |
12 str: str, | 12 str: str, |
13 fn: function() { return "result"; } | 13 fn: function() { return "result"; } |
14 }; | 14 }; |
15 | 15 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 assertEquals(1, calls); | 323 assertEquals(1, calls); |
324 })(); | 324 })(); |
325 | 325 |
326 | 326 |
327 (function testUTF16ByteOrderMark() { | 327 (function testUTF16ByteOrderMark() { |
328 assertEquals("\uFEFFtest", `\uFEFFtest`); | 328 assertEquals("\uFEFFtest", `\uFEFFtest`); |
329 assertEquals("\uFEFFtest", eval("`\uFEFFtest`")); | 329 assertEquals("\uFEFFtest", eval("`\uFEFFtest`")); |
330 })(); | 330 })(); |
331 | 331 |
332 | 332 |
| 333 (function testStringRawAsTagFn() { |
| 334 assertEquals("\\u0065\\`\\r\\r\\n\\ntestcheck", |
| 335 String.raw`\u0065\`\r\r\n\n${"test"}check`); |
| 336 assertEquals("\\\n\\\n\\\n", eval("String.raw`\\\r\\\r\n\\\n`")); |
| 337 assertEquals("", String.raw``); |
| 338 })(); |
| 339 |
| 340 |
333 (function testExtendedArrayPrototype() { | 341 (function testExtendedArrayPrototype() { |
334 Object.defineProperty(Array.prototype, 0, { | 342 Object.defineProperty(Array.prototype, 0, { |
335 set: function() { | 343 set: function() { |
336 assertUnreachable(); | 344 assertUnreachable(); |
337 } | 345 } |
338 }); | 346 }); |
339 function tag(){} | 347 function tag(){} |
340 tag`a${1}b`; | 348 tag`a${1}b`; |
341 })(); | 349 })(); |
OLD | NEW |