TypeScript/tests/baselines/reference/moduleExportAliasExports.types
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

31 lines
1.2 KiB
Plaintext

=== tests/cases/conformance/salsa/Eloquent.js ===
// bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript
(function() {
>(function() {exports.bigOak = 1exports.everywhere = 2module.exports = exports})() : void
>(function() {exports.bigOak = 1exports.everywhere = 2module.exports = exports}) : () => void
>function() {exports.bigOak = 1exports.everywhere = 2module.exports = exports} : () => void
exports.bigOak = 1
>exports.bigOak = 1 : 1
>exports.bigOak : number
>exports : typeof import("tests/cases/conformance/salsa/Eloquent")
>bigOak : number
>1 : 1
exports.everywhere = 2
>exports.everywhere = 2 : 2
>exports.everywhere : number
>exports : typeof import("tests/cases/conformance/salsa/Eloquent")
>everywhere : number
>2 : 2
module.exports = exports
>module.exports = exports : typeof import("tests/cases/conformance/salsa/Eloquent")
>module.exports : typeof import("tests/cases/conformance/salsa/Eloquent")
>module : { exports: typeof import("tests/cases/conformance/salsa/Eloquent"); }
>exports : typeof import("tests/cases/conformance/salsa/Eloquent")
>exports : typeof import("tests/cases/conformance/salsa/Eloquent")
})()