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
22 lines
868 B
Plaintext
22 lines
868 B
Plaintext
=== tests/cases/conformance/salsa/bug24024.js ===
|
|
// #24024
|
|
var wat = require('./bug24024')
|
|
>wat : Symbol(wat, Decl(bug24024.js, 1, 3))
|
|
>require : Symbol(require)
|
|
>'./bug24024' : Symbol("tests/cases/conformance/salsa/bug24024", Decl(bug24024.js, 0, 0))
|
|
|
|
module.exports = class C {}
|
|
>module.exports : Symbol(module.exports, Decl(bug24024.js, 0, 0))
|
|
>module : Symbol(export=, Decl(bug24024.js, 1, 31))
|
|
>exports : Symbol(export=, Decl(bug24024.js, 1, 31))
|
|
>C : Symbol(wat, Decl(bug24024.js, 2, 16))
|
|
|
|
module.exports.D = class D { }
|
|
>module.exports.D : Symbol(wat.D, Decl(bug24024.js, 2, 27))
|
|
>module.exports : Symbol(wat.D, Decl(bug24024.js, 2, 27))
|
|
>module : Symbol(module, Decl(bug24024.js, 1, 31))
|
|
>exports : Symbol(module.exports, Decl(bug24024.js, 0, 0))
|
|
>D : Symbol(wat.D, Decl(bug24024.js, 2, 27))
|
|
>D : Symbol(wat.D, Decl(bug24024.js, 3, 18))
|
|
|