Files
tsgo/testdata/baselines/reference/submodule/conformance/constructorFunctionsStrict.symbols

58 lines
1.3 KiB
Plaintext

//// [tests/cases/conformance/salsa/constructorFunctionsStrict.ts] ////
=== a.js ===
/** @param {number} x */
function C(x) {
>C : Symbol(C, Decl(a.js, 0, 0))
>x : Symbol(x, Decl(a.js, 1, 11))
this.x = x
>x : Symbol(x, Decl(a.js, 1, 11))
}
C.prototype.m = function() {
>C.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(a.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --))
this.y = 12
}
var c = new C(1)
>c : Symbol(c, Decl(a.js, 7, 3))
>C : Symbol(C, Decl(a.js, 0, 0))
c.x = undefined // should error
>c : Symbol(c, Decl(a.js, 7, 3))
>undefined : Symbol(undefined)
c.y = undefined // ok
>c : Symbol(c, Decl(a.js, 7, 3))
>undefined : Symbol(undefined)
/** @param {number} x */
function A(x) {
>A : Symbol(A, Decl(a.js, 9, 15))
>x : Symbol(x, Decl(a.js, 12, 11))
if (!(this instanceof A)) {
>A : Symbol(A, Decl(a.js, 9, 15))
return new A(x)
>A : Symbol(A, Decl(a.js, 9, 15))
>x : Symbol(x, Decl(a.js, 12, 11))
}
this.x = x
>x : Symbol(x, Decl(a.js, 12, 11))
}
var k = A(1)
>k : Symbol(k, Decl(a.js, 18, 3))
>A : Symbol(A, Decl(a.js, 9, 15))
var j = new A(2)
>j : Symbol(j, Decl(a.js, 19, 3))
>A : Symbol(A, Decl(a.js, 9, 15))
k.x === j.x
>k : Symbol(k, Decl(a.js, 18, 3))
>j : Symbol(j, Decl(a.js, 19, 3))