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

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: parser fix 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 // Flags: --harmony-strings
6
7 function toSurrogatePair(c) {
8 return String.fromCharCode(((c - 0x10000) >>> 10) & 0x3FF | 0xD800) +
9 String.fromCharCode(c & 0x3FF | 0xDC00);
mathias 2014/10/09 14:45:42 Since `--harmony-strings` is set anyway, why not u
Yang 2014/10/09 14:50:18 Apparently flags are not parsed in intl/ tests. I'
10 }
11
12 function testIdStart(c, is_id_start) {
13 var source = "var " + toSurrogatePair(c);
14 print(source);
15 if (is_id_start) {
16 assertDoesNotThrow(source);
17 } else {
18 assertThrows(source);
19 }
20 }
21
22 function testIdPart(c, is_id_start) {
23 var source = "var v" + toSurrogatePair(c);
24 print(source);
25 if (is_id_start) {
26 assertDoesNotThrow(source);
27 } else {
28 assertThrows(source);
29 }
30 }
31
32 [0x10403, 0x1043C, 0x16F9C, 0x10048, 0x1014D].forEach(function(c) {
33 testIdStart(c, true);
34 testIdPart(c, true);
35 });
36
37 [0x101FD, 0x11002, 0x104A9].forEach(function(c) {
38 testIdStart(c, false);
39 testIdPart(c, true);
40 });
41
42 [0x10111, 0x1F4A9].forEach(function(c) {
43 testIdStart(c, false);
44 testIdPart(c, false);
45 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698