File: globalThisBlockscopedProperties.symbols

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 (57 lines) | stat: -rw-r--r-- 2,071 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
=== tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts ===
var x = 1
>x : Symbol(x, Decl(globalThisBlockscopedProperties.ts, 0, 3))

const y = 2
>y : Symbol(y, Decl(globalThisBlockscopedProperties.ts, 1, 5))

let z = 3
>z : Symbol(z, Decl(globalThisBlockscopedProperties.ts, 2, 3))

globalThis.x // ok
>globalThis.x : Symbol(x, Decl(globalThisBlockscopedProperties.ts, 0, 3))
>globalThis : Symbol(globalThis)
>x : Symbol(x, Decl(globalThisBlockscopedProperties.ts, 0, 3))

globalThis.y // should error, no property 'y'
>globalThis : Symbol(globalThis)

globalThis.z // should error, no property 'z'
>globalThis : Symbol(globalThis)

globalThis['x'] // ok
>globalThis : Symbol(globalThis)
>'x' : Symbol(x, Decl(globalThisBlockscopedProperties.ts, 0, 3))

globalThis['y'] // should error, no property 'y'
>globalThis : Symbol(globalThis)

globalThis['z'] // should error, no property 'z'
>globalThis : Symbol(globalThis)

globalThis.Float64Array // ok
>globalThis.Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>globalThis : Symbol(globalThis)
>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

globalThis.Infinity // ok
>globalThis.Infinity : Symbol(Infinity, Decl(lib.es5.d.ts, --, --))
>globalThis : Symbol(globalThis)
>Infinity : Symbol(Infinity, Decl(lib.es5.d.ts, --, --))

declare let test1: (typeof globalThis)['x'] // ok
>test1 : Symbol(test1, Decl(globalThisBlockscopedProperties.ts, 12, 11))
>globalThis : Symbol(globalThis)

declare let test2: (typeof globalThis)['y'] // error
>test2 : Symbol(test2, Decl(globalThisBlockscopedProperties.ts, 13, 11))
>globalThis : Symbol(globalThis)

declare let test3: (typeof globalThis)['z'] // error
>test3 : Symbol(test3, Decl(globalThisBlockscopedProperties.ts, 14, 11))
>globalThis : Symbol(globalThis)

declare let themAll: keyof typeof globalThis
>themAll : Symbol(themAll, Decl(globalThisBlockscopedProperties.ts, 15, 11))
>globalThis : Symbol(globalThis)