tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

6.1.js (726B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es5id: 6.1
      6 description: Test for handling of supplementary characters
      7 ---*/
      8 
      9 var chars = "𐒠";  // Single Unicode character at codepoint \u{104A0}
     10 if(chars.length !== 2) {
     11    throw new Test262Error("A character outside the BMP (Unicode CodePoint > 0xFFFF) should consume two code units");
     12 }
     13 if(chars.charCodeAt(0) !== 0xD801) {
     14    throw new Test262Error("First code unit of surrogate pair for 0x104A0 should be 0xD801");
     15 }
     16 
     17 if(chars.charCodeAt(1) !== 0xDCA0) {
     18    throw new Test262Error("Second code unit of surrogate pair for 0x104A0 should be 0xDCA0");
     19 }
     20 
     21 reportCompare(0, 0);