| 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 // ES6 extends the \uxxxx escape and also allows \u{xxxxx}. | 5 // ES6 extends the \uxxxx escape and also allows \u{xxxxx}. |
| 6 | 6 |
| 7 // Flags: --harmony-unicode | |
| 8 | |
| 9 // Unicode escapes in variable names. | 7 // Unicode escapes in variable names. |
| 10 | 8 |
| 11 (function TestVariableNames1() { | 9 (function TestVariableNames1() { |
| 12 var foobar = 1; | 10 var foobar = 1; |
| 13 assertEquals(foob\u0061r, 1); | 11 assertEquals(foob\u0061r, 1); |
| 14 assertEquals(foob\u{0061}r, 1); | 12 assertEquals(foob\u{0061}r, 1); |
| 15 assertEquals(foob\u{61}r, 1); | 13 assertEquals(foob\u{61}r, 1); |
| 16 assertEquals(foob\u{0000000061}r, 1); | 14 assertEquals(foob\u{0000000061}r, 1); |
| 17 })(); | 15 })(); |
| 18 | 16 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 assertEquals(s4, "foobar"); | 35 assertEquals(s4, "foobar"); |
| 38 })(); | 36 })(); |
| 39 | 37 |
| 40 | 38 |
| 41 (function TestSurrogates() { | 39 (function TestSurrogates() { |
| 42 // U+10E6D corresponds to the surrogate pair [U+D803, U+DE6D]. | 40 // U+10E6D corresponds to the surrogate pair [U+D803, U+DE6D]. |
| 43 var s1 = "foo\u{10e6d}"; | 41 var s1 = "foo\u{10e6d}"; |
| 44 var s2 = "foo\u{d803}\u{de6d}"; | 42 var s2 = "foo\u{d803}\u{de6d}"; |
| 45 assertEquals(s1, s2); | 43 assertEquals(s1, s2); |
| 46 })(); | 44 })(); |
| OLD | NEW |