6.1.js 573 B

12345678910111213141516
  1. // Copyright (c) 2012 Ecma International. All rights reserved.
  2. /**
  3. * @description Test for handling of supplementary characters
  4. */
  5. var chars = "𐒠"; // Single Unicode character at codepoint \u{104A0}
  6. if(chars.length !== 2) {
  7. $ERROR("A character outside the BMP (Unicode CodePoint > 0xFFFF) should consume two code units");
  8. }
  9. if(chars.charCodeAt(0) !== 0xD801) {
  10. $ERROR("First code unit of surrogate pair for 0x104A0 should be 0xD801");
  11. }
  12. if(chars.charCodeAt(1) !== 0xDCA0) {
  13. $ERROR("Second code unit of surrogate pair for 0x104A0 should be 0xDCA0");
  14. }