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-unicode |
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 (function testExtendedArrayPrototype() { | 422 (function testExtendedArrayPrototype() { |
423 Object.defineProperty(Array.prototype, 0, { | 423 Object.defineProperty(Array.prototype, 0, { |
424 set: function() { | 424 set: function() { |
425 assertUnreachable(); | 425 assertUnreachable(); |
426 } | 426 } |
427 }); | 427 }); |
428 function tag(){} | 428 function tag(){} |
429 tag`a${1}b`; | 429 tag`a${1}b`; |
430 })(); | 430 })(); |
| 431 |
| 432 |
| 433 (function testRawLineNormalization() { |
| 434 function raw0(callSiteObj) { |
| 435 return callSiteObj.raw[0]; |
| 436 } |
| 437 assertEquals(eval("raw0`\r`"), "\n"); |
| 438 assertEquals(eval("raw0`\r\n`"), "\n"); |
| 439 assertEquals(eval("raw0`\r\r\n`"), "\n\n"); |
| 440 assertEquals(eval("raw0`\r\n\r\n`"), "\n\n"); |
| 441 assertEquals(eval("raw0`\r\r\r\n`"), "\n\n\n"); |
| 442 })(); |
| 443 |
| 444 |
| 445 (function testHarmonyUnicode() { |
| 446 function raw0(callSiteObj) { |
| 447 return callSiteObj.raw[0]; |
| 448 } |
| 449 assertEquals(raw0`a\u{62}c`, "a\\u{62}c"); |
| 450 assertEquals(raw0`a\u{000062}c`, "a\\u{000062}c"); |
| 451 assertEquals(raw0`a\u{0}c`, "a\\u{0}c"); |
| 452 |
| 453 assertEquals(`a\u{62}c`, "abc"); |
| 454 assertEquals(`a\u{000062}c`, "abc"); |
| 455 })(); |
OLD | NEW |