File: globalThisBlockscopedProperties.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (38 lines) | stat: -rw-r--r-- 2,197 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(5,12): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(6,12): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(8,1): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(9,1): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(14,40): error TS2339: Property 'y' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts(15,40): error TS2339: Property 'z' does not exist on type 'typeof globalThis'.


==== tests/cases/conformance/es2019/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