TypeScript/tests/cases/compiler/extendedUnicodePlaneIdentifiers.ts
Wesley Wigham 7adc175dfc
Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long (#32720)
* Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long

* Add a few examples with mixed unicode characters

* for posterity, add some unicode cursive script characters

* Test some more planes more explicitly
2019-08-05 23:37:26 -07:00

39 lines
771 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @target: es2018
const 𝑚 = 4;
const 𝑀 = 5;
console.log(𝑀 + 𝑚); // 9
// lower 8 bits look like 'a'
const = 6;
console.log( ** );
// lower 8 bits aren't a valid unicode character
const = 7;
console.log( ** );
// a mix, for good measure
const 𝑀 = 7;
console.log(𝑀 ** 𝑀);
const 𝑀 = 7;
console.log(𝑀 ** 𝑀);
const 𝑀 = 7;
console.log(𝑀 ** 𝑀);
const 𝓱𝓮𝓵𝓵𝓸 = "𝔀𝓸𝓻𝓵𝓭";
const = "ok"; // BMP
const 𓀸𓀹𓀺 = "ok"; // SMP
const 𡚭𡚮𡚯 = "ok"; // SIP
const 𡚭𓀺𝓮 = "ok";
const 𓀺𝓮𡚭 = "ok";
const 𝓮𡚭𓀺 = "ok";
const 𝓮𡚭𓀺 = "ok";