mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 21:21:31 +03:00
18 lines
545 B
TypeScript
18 lines
545 B
TypeScript
// @noImplicitAny: true
|
|
var x = 1
|
|
const y = 2
|
|
let z = 3
|
|
globalThis.x // ok
|
|
globalThis.y // should error, no property 'y'
|
|
globalThis.z // should error, no property 'z'
|
|
globalThis['x'] // ok
|
|
globalThis['y'] // should error, no property 'y'
|
|
globalThis['z'] // should error, no property 'z'
|
|
globalThis.Float64Array // ok
|
|
globalThis.Infinity // ok
|
|
|
|
declare let test1: (typeof globalThis)['x'] // ok
|
|
declare let test2: (typeof globalThis)['y'] // error
|
|
declare let test3: (typeof globalThis)['z'] // error
|
|
declare let themAll: keyof typeof globalThis
|