mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
38 lines
1.9 KiB
Plaintext
38 lines
1.9 KiB
Plaintext
globalThisBlockscopedProperties.ts(5,12): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
globalThisBlockscopedProperties.ts(6,12): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
globalThisBlockscopedProperties.ts(8,1): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
globalThisBlockscopedProperties.ts(9,1): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
globalThisBlockscopedProperties.ts(14,40): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
globalThisBlockscopedProperties.ts(15,40): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
|
|
|
|
==== globalThisBlockscopedProperties.ts (6 errors) ====
|
|
var x = 1
|
|
const y = 2
|
|
let z = 3
|
|
globalThis.x // ok
|
|
globalThis.y // should error, no property 'y'
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
globalThis.z // should error, no property 'z'
|
|
~
|
|
!!! error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
globalThis['x'] // ok
|
|
globalThis['y'] // should error, no property 'y'
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
globalThis['z'] // should error, no property 'z'
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
globalThis.Float64Array // ok
|
|
globalThis.Infinity // ok
|
|
|
|
declare let test1: (typeof globalThis)['x'] // ok
|
|
declare let test2: (typeof globalThis)['y'] // error
|
|
~~~
|
|
!!! error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
|
|
declare let test3: (typeof globalThis)['z'] // error
|
|
~~~
|
|
!!! error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
|
|
declare let themAll: keyof typeof globalThis
|
|
|