File: lateBoundAssignmentDeclarationSupport3.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (67 lines) | stat: -rw-r--r-- 2,309 bytes parent folder | download | duplicates (3)
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
58
59
60
61
62
63
64
65
66
67
=== tests/cases/conformance/salsa/usage.js ===
const x = require("./lateBoundAssignmentDeclarationSupport3.js");
>x : typeof x
>require("./lateBoundAssignmentDeclarationSupport3.js") : typeof x
>require : any
>"./lateBoundAssignmentDeclarationSupport3.js" : "./lateBoundAssignmentDeclarationSupport3.js"

const y = x["my-fake-sym"];
>y : any
>x["my-fake-sym"] : any
>x : typeof x
>"my-fake-sym" : "my-fake-sym"

const z = x[x.S];
>z : any
>x[x.S] : any
>x : typeof x
>x.S : unique symbol
>x : typeof x
>S : unique symbol

=== tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3.js ===
// currently unsupported
const _sym = Symbol();
>_sym : unique symbol
>Symbol() : unique symbol
>Symbol : SymbolConstructor

const _str = "my-fake-sym";
>_str : "my-fake-sym"
>"my-fake-sym" : "my-fake-sym"

Object.defineProperty(module.exports, _sym, { value: "ok" });
>Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof module.exports
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>Object : ObjectConstructor
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>module.exports : typeof module.exports
>module : { exports: typeof module.exports; }
>exports : typeof module.exports
>_sym : unique symbol
>{ value: "ok" } : { value: string; }
>value : string
>"ok" : "ok"

Object.defineProperty(module.exports, _str, { value: "ok" });
>Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof module.exports
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>Object : ObjectConstructor
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>module.exports : typeof module.exports
>module : { exports: typeof module.exports; }
>exports : typeof module.exports
>_str : "my-fake-sym"
>{ value: "ok" } : { value: string; }
>value : string
>"ok" : "ok"

module.exports.S = _sym;
>module.exports.S = _sym : unique symbol
>module.exports.S : unique symbol
>module.exports : typeof module.exports
>module : { exports: typeof module.exports; }
>exports : typeof module.exports
>S : unique symbol
>_sym : unique symbol