aba932aefa
* 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
23 lines
1 KiB
Plaintext
23 lines
1 KiB
Plaintext
=== tests/cases/conformance/jsdoc/declarations/index.js ===
|
|
function foo() {}
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
|
|
foo.foo = foo;
|
|
>foo.foo : Symbol(foo.foo, Decl(index.js, 0, 17))
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
>foo : Symbol(foo.foo, Decl(index.js, 0, 17))
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
|
|
foo.default = foo;
|
|
>foo.default : Symbol(foo.default, Decl(index.js, 2, 14))
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
>default : Symbol(foo.default, Decl(index.js, 2, 14))
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
|
|
module.exports = foo;
|
|
>module.exports : Symbol(module.exports, Decl(index.js, 0, 0))
|
|
>module : Symbol(export=, Decl(index.js, 3, 18))
|
|
>exports : Symbol(export=, Decl(index.js, 3, 18))
|
|
>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14))
|
|
|