TypeScript/tests/cases/conformance/salsa/moduleExportAliasExports.ts
Nathan Shively-Sanders e379aeb151
Fix alias of module.exports->exports->IIFE (#27992)
In JS, when you assign `module.exports = exports` and the entire module is
wrapped in an IIFE, the resulting `export=` symbol, after following
aliases, is the module itself. This results in trying to merge the
file's exports with itself inside `getCommonJsExportEquals`, since it
thinks that it has found new exports, possibly in an object literal,
that need to be merged with the file's exports.

For example:

```js
(function() {
exports.a = 1
module.exports = exports
})()
```
2018-10-19 13:50:38 -07:00

11 lines
232 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: Eloquent.js
// bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript
(function() {
exports.bigOak = 1
exports.everywhere = 2
module.exports = exports
})()