TypeScript/tests/baselines/reference/jsDeclarationsExportAssignedClassExpressionShadowing.symbols
Nathan Shively-Sanders aba932aefa
Create synthetic exports symbol for commonjs module (#42655)
* Commonjs module:create synthetic exports symbol

Previously, the `module` identifier in commonjs modules got a synthetic
type with a single property `exports`. The exports property reused the
file's symbol, which, for a module file, gives the correct exported
properties.

However, the name of this symbol was still the filename of the file, not
`exports`. This PR creates a synthetic symbol for `exports` by copying
in a similar way to esModuleInterop's `default` symbol in
`resolveESModuleSymbol` (although the intent there is to strip off
signatures from the symbol).

* correct parent of synthetic symbol
2021-02-05 10:56:03 -08:00

37 lines
1.1 KiB
Plaintext

=== tests/cases/conformance/jsdoc/declarations/index.js ===
class A {
>A : Symbol(A, Decl(index.js, 0, 0))
member = new Q();
>member : Symbol(A.member, Decl(index.js, 0, 9))
>Q : Symbol(Q, Decl(index.js, 2, 1))
}
class Q {
>Q : Symbol(Q, Decl(index.js, 2, 1))
x = 42;
>x : Symbol(Q.x, Decl(index.js, 3, 9))
}
module.exports = class Q {
>module.exports : Symbol(module.exports, Decl(index.js, 0, 0))
>module : Symbol(export=, Decl(index.js, 5, 1))
>exports : Symbol(export=, Decl(index.js, 5, 1))
>Q : Symbol(Q, Decl(index.js, 6, 16))
constructor() {
this.x = new A();
>this.x : Symbol(Q.x, Decl(index.js, 7, 19))
>this : Symbol(Q, Decl(index.js, 6, 16))
>x : Symbol(Q.x, Decl(index.js, 7, 19))
>A : Symbol(A, Decl(index.js, 0, 0))
}
}
module.exports.Another = Q;
>module.exports.Another : Symbol(Another, Decl(index.js, 10, 1))
>module.exports : Symbol(Another, Decl(index.js, 10, 1))
>module : Symbol(module, Decl(index.js, 5, 1))
>exports : Symbol(module.exports, Decl(index.js, 0, 0))
>Another : Symbol(Another, Decl(index.js, 10, 1))
>Q : Symbol(Q, Decl(index.js, 2, 1))