TypeScript/tests/baselines/reference/assignmentToVoidZero1.symbols
Nathan Shively-Sanders 0d84f210b7
In JS, assignment to void 0 isn't a declaration (#39452)
Previously, property assignments with `void 0` initialisers were treated
like any other values. But this causes us to choke when checking our own
commonjs emit. This is something that happens by mistake a fair amount,
so this PR goes back to treating these assignments as normal
assignments.

This should allow us to check our own emit in loose cases without
harming other code bases, since `void 0` is rarely written by hand.

Note that other errors still happen: noImplicitAny forbids
accessing undeclared properties on object literals, and strictNullChecks
forbids assigning `undefined` to properties with a different type.
However, this change is enough to unblock compilation with
`strictNullChecks: false`.
2020-07-06 14:00:12 -07:00

21 lines
964 B
Plaintext

=== tests/cases/conformance/salsa/assignmentToVoidZero1.js ===
// #38552
exports.y = exports.x = void 0;
>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>exports : Symbol("tests/cases/conformance/salsa/assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
>exports : Symbol("tests/cases/conformance/salsa/assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
exports.x = 1;
>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
>exports : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
exports.y = 2;
>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>exports : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))