Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: test/intl/general/smp-identifier.js

Issue 640193002: Allow identifier code points from supplementary multilingual planes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 function toSurrogatePair(c) {
6 return String.fromCharCode(((c - 0x10000) >>> 10) & 0x3FF | 0xD800) +
7 String.fromCharCode(c & 0x3FF | 0xDC00);
8 }
9
10 function testIdStart(c, is_id_start) {
11 var source = "var " + toSurrogatePair(c);
12 print(source);
13 if (is_id_start) {
14 assertDoesNotThrow(source);
15 } else {
16 assertThrows(source);
17 }
18 }
19
20 function testIdPart(c, is_id_start) {
21 var source = "var v" + toSurrogatePair(c);
22 print(source);
23 if (is_id_start) {
24 assertDoesNotThrow(source);
25 } else {
26 assertThrows(source);
27 }
28 }
29
30 [0x10403, 0x1043C, 0x16F9C, 0x10048, 0x1014D].forEach(function(c) {
31 testIdStart(c, true);
32 testIdPart(c, true);
33 });
34
35 [0x101FD, 0x11002, 0x104A9].forEach(function(c) {
36 testIdStart(c, false);
37 testIdPart(c, true);
38 });
39
40 [0x10111, 0x1F4A9].forEach(function(c) {
41 testIdStart(c, false);
42 testIdPart(c, false);
43 });
OLDNEW
« src/scanner.h ('K') | « src/scanner.h ('k') | test/mjsunit/parse-surrogates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698