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 |
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 = { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 callSites = []; | 395 callSites = []; |
396 | 396 |
397 tag`\uc548\ub155`; | 397 tag`\uc548\ub155`; |
398 tag`안녕`; | 398 tag`안녕`; |
399 assertEquals(2, callSites.length); | 399 assertEquals(2, callSites.length); |
400 assertTrue(callSites[0] !== callSites[1]); | 400 assertTrue(callSites[0] !== callSites[1]); |
401 assertEquals("안녕", callSites[0][0]); | 401 assertEquals("안녕", callSites[0][0]); |
402 assertEquals("\\uc548\\ub155", callSites[0].raw[0]); | 402 assertEquals("\\uc548\\ub155", callSites[0].raw[0]); |
403 assertEquals("안녕", callSites[1][0]); | 403 assertEquals("안녕", callSites[1][0]); |
404 // TODO(caitp, arv): blocked on correctly generating raw strings from | 404 assertEquals("안녕", callSites[1].raw[0]); |
405 // multi-byte UTF8. | 405 |
406 // assertEquals("안녕", callSites[1].raw[0]); | 406 // Extra-thorough UTF8 decoding test. |
| 407 callSites = []; |
| 408 |
| 409 tag`Iñtërnâtiônàlizætiøn\u2603\uD83D\uDCA9`; |
| 410 tag`Iñtërnâtiônàlizætiøn☃💩`; |
| 411 |
| 412 assertEquals(2, callSites.length); |
| 413 assertTrue(callSites[0] !== callSites[1]); |
| 414 assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[0][0]); |
| 415 assertEquals( |
| 416 "Iñtërnâtiônàlizætiøn\\u2603\\uD83D\\uDCA9", callSites[0].raw[0]); |
| 417 assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[1][0]); |
| 418 assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[1].raw[0]); |
407 })(); | 419 })(); |
408 | 420 |
409 | 421 |
410 (function testExtendedArrayPrototype() { | 422 (function testExtendedArrayPrototype() { |
411 Object.defineProperty(Array.prototype, 0, { | 423 Object.defineProperty(Array.prototype, 0, { |
412 set: function() { | 424 set: function() { |
413 assertUnreachable(); | 425 assertUnreachable(); |
414 } | 426 } |
415 }); | 427 }); |
416 function tag(){} | 428 function tag(){} |
417 tag`a${1}b`; | 429 tag`a${1}b`; |
418 })(); | 430 })(); |
OLD | NEW |