TypeScript/tests/baselines/reference/extendedUnicodePlaneIdentifiers.js
Nathan Shively-Sanders 71cdf6a920
Private identifiers use standard identifier scanning (#44184)
* Private identifiers use standard identifer scanning

Previously they used an old copy of the identifier scanning code that
didn't handle extended unicode yet.

* gotta fix that const lint
2021-05-20 14:39:31 -07:00

79 lines
1.7 KiB
TypeScript
Raw Permalink 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.

//// [extendedUnicodePlaneIdentifiers.ts]
const 𝑚 = 4;
const 𝑀 = 5;
console.log(𝑀 + 𝑚); // 9
class K {
#𝑚 = 4;
#𝑀 = 5;
}
// 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";
//// [extendedUnicodePlaneIdentifiers.js]
var _K_𝑚, _K_𝑀;
const 𝑚 = 4;
const 𝑀 = 5;
console.log(𝑀 + 𝑚); // 9
class K {
constructor() {
_K_𝑚.set(this, 4);
_K_𝑀.set(this, 5);
}
}
_K_𝑚 = new WeakMap(), _K_𝑀 = new WeakMap();
// 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";