First in UMD global wins

Fixes #9771
This commit is contained in:
Ryan Cavanaugh
2016-08-26 08:49:43 -07:00
parent c72f5e28e8
commit 0116abdcf2
5 changed files with 103 additions and 1 deletions

View File

@@ -18763,7 +18763,13 @@ namespace ts {
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
}
if (file.symbol && file.symbol.globalExports) {
mergeSymbolTable(globals, file.symbol.globalExports);
// Merge in UMD exports with first-in-wins semantics (see #9771)
const source = file.symbol.globalExports;
for (const id in source) {
if (!(id in globals)) {
globals[id] = source[id];
}
}
}
});