mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
992 B
Plaintext
43 lines
992 B
Plaintext
//// [tests/cases/conformance/salsa/thisPropertyAssignment.ts] ////
|
||
|
||
=== a.js ===
|
||
// This test is asserting that a single property/element access
|
||
// on `this` is a special assignment declaration, but chaining
|
||
// off that does not create additional declarations. I’m not sure
|
||
// if it needs to be that way in JavaScript; the test simply
|
||
// ensures no accidental changes were introduced while allowing
|
||
// element access assignments to create declarations.
|
||
|
||
this.x = {};
|
||
>this : Symbol(globalThis)
|
||
|
||
this.x.y = {};
|
||
>this : Symbol(globalThis)
|
||
|
||
this["y"] = {};
|
||
>this : Symbol(globalThis)
|
||
|
||
this["y"]["z"] = {};
|
||
>this : Symbol(globalThis)
|
||
|
||
/** @constructor */
|
||
function F() {
|
||
>F : Symbol(F, Decl(a.js, 10, 20))
|
||
|
||
this.a = {};
|
||
this.a.b = {};
|
||
this["b"] = {};
|
||
this["b"]["c"] = {};
|
||
}
|
||
|
||
const f = new F();
|
||
>f : Symbol(f, Decl(a.js, 20, 5))
|
||
>F : Symbol(F, Decl(a.js, 10, 20))
|
||
|
||
f.a;
|
||
>f : Symbol(f, Decl(a.js, 20, 5))
|
||
|
||
f.b;
|
||
>f : Symbol(f, Decl(a.js, 20, 5))
|
||
|