https://github.com/Microsoft/TypeScript
Revision b77cb2ac458448dbf0dfcbdc42859c74812c4408 authored by Nathan Shively-Sanders on 26 September 2018, 17:54:26 UTC, committed by GitHub on 26 September 2018, 17:54:26 UTC
I'm surprised we haven't seen more of this; I suspect it's because the
mixed `module.exports=` + `export.foo=` pattern isn't that common.
However, it'll happen any time that the exported symbol is unknown;
getCommonJsExportEquals blithely clones unknownSymbol and proceeds to
stick the `exports.foo=` properties onto it.

This causes problems later, because the compiler checks for
unknownSymbol with `===`. The fix is to not stick properties onto a
clone of unknownSymbol. This makes the correct errors appear and removes
the crash.
1 parent f4a643f
History
Tip revision: b77cb2ac458448dbf0dfcbdc42859c74812c4408 authored by Nathan Shively-Sanders on 26 September 2018, 17:54:26 UTC
Fix commonjs export= merging (#27368)
Tip revision: b77cb2a
File Mode Size
.github
.vscode
bin
doc
lib
scripts
src
tests
.editorconfig -rw-r--r-- 188 bytes
.gitattributes -rw-r--r-- 42 bytes
.gitignore -rw-r--r-- 2.0 KB
.gitmodules -rw-r--r-- 2.0 KB
.mailmap -rw-r--r-- 18.6 KB
.npmignore -rw-r--r-- 312 bytes
.npmrc -rw-r--r-- 18 bytes
.travis.yml -rw-r--r-- 407 bytes
AUTHORS.md -rw-r--r-- 6.0 KB
CONTRIBUTING.md -rw-r--r-- 9.3 KB
CopyrightNotice.txt -rw-r--r-- 819 bytes
Gulpfile.js -rw-r--r-- 26.6 KB
Jakefile.js -rw-r--r-- 33.4 KB
LICENSE.txt -rw-r--r-- 9.0 KB
README.md -rw-r--r-- 4.8 KB
ThirdPartyNoticeText.txt -rw-r--r-- 36.9 KB
package.json -rw-r--r-- 3.5 KB
tslint.json -rw-r--r-- 4.7 KB

README.md

back to top