this: undefined in modules (#37784)

It's always supposed to have been this way, but I was worried about how
breaky the change would be when adding globalThisType. This PR is
experiment to see how much.

Fixes #35882 maybe
This commit is contained in:
Nathan Shively-Sanders
2020-04-28 10:42:24 -07:00
committed by GitHub
parent 167f954ec7
commit 12cd15c867
16 changed files with 72 additions and 22 deletions

View File

@@ -21660,6 +21660,10 @@ namespace ts {
const fileSymbol = getSymbolOfNode(container);
return fileSymbol && getTypeOfSymbol(fileSymbol);
}
else if (container.externalModuleIndicator) {
// TODO: Maybe issue a better error than 'object is possibly undefined'
return undefinedType;
}
else if (includeGlobalThis) {
return getTypeOfSymbol(globalThisSymbol);
}