fix CommonJs modules no longer affecting the global scope (#43090)

This commit is contained in:
Tobias Koppers 2021-03-20 00:24:17 +01:00 committed by GitHub
parent 5813907abf
commit 8a5939fdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -472,7 +472,7 @@ namespace ts {
*/
function isFileAffectingGlobalScope(sourceFile: SourceFile) {
return containsGlobalScopeAugmentation(sourceFile) ||
!isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile);
!isExternalOrCommonJsModule(sourceFile) && !containsOnlyAmbientModules(sourceFile);
}
/**

View File

@ -151,7 +151,7 @@ module.exports = {};
"../../src/common/nominal.js": {
"version": "-9003723607-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};\n",
"signature": "-15964609857-export type Nominal<T, Name> = T & {\r\n [Symbol.species]: Name;\r\n};\r\n",
"affectsGlobalScope": true
"affectsGlobalScope": false
}
},
"options": {