diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-11-14 00:52:27 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2014-11-14 16:34:58 +0100 |
commit | 5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1 (patch) | |
tree | ab5f510c4d83b175681de629395525bf7ec7cedb /deps/v8/test/intl | |
parent | 3b3d89bad26f5dfebe73fef6ae284ee78acbd5c9 (diff) | |
download | android-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.gz android-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.bz2 android-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.zip |
deps: upgrade v8 to 3.30.37
Diffstat (limited to 'deps/v8/test/intl')
-rw-r--r-- | deps/v8/test/intl/general/smp-identifier.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/deps/v8/test/intl/general/smp-identifier.js b/deps/v8/test/intl/general/smp-identifier.js new file mode 100644 index 0000000000..8a8d2e6b6f --- /dev/null +++ b/deps/v8/test/intl/general/smp-identifier.js @@ -0,0 +1,43 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function toSurrogatePair(c) { + return String.fromCharCode(((c - 0x10000) >>> 10) & 0x3FF | 0xD800) + + String.fromCharCode(c & 0x3FF | 0xDC00); +} + +function testIdStart(c, is_id_start) { + var source = "var " + toSurrogatePair(c); + print(source); + if (is_id_start) { + assertDoesNotThrow(source); + } else { + assertThrows(source); + } +} + +function testIdPart(c, is_id_start) { + var source = "var v" + toSurrogatePair(c); + print(source); + if (is_id_start) { + assertDoesNotThrow(source); + } else { + assertThrows(source); + } +} + +[0x10403, 0x1043C, 0x16F9C, 0x10048, 0x1014D].forEach(function(c) { + testIdStart(c, true); + testIdPart(c, true); +}); + +[0x101FD, 0x11002, 0x104A9].forEach(function(c) { + testIdStart(c, false); + testIdPart(c, true); +}); + +[0x10111, 0x1F4A9].forEach(function(c) { + testIdStart(c, false); + testIdPart(c, false); +}); |