Fix crash intersecting dynamic import w/esModuleInterop (#40249)

* Fix crash intersecting dynamic import w/esModuleInterop

The dynamic import shim creates a symbol without some properties that
the intersection-creating code assumes are present as of #38673.

This PR adds the smallest possible set of properties to avoid the crash.
I'm not sure what others would be good to add.

* Use symbol's declarations instead

* Fix getResolvedMembersOrExportsOfSymbol instead

* comment from code review
This commit is contained in:
Nathan Shively-Sanders
2020-09-01 09:10:36 -07:00
committed by GitHub
parent 378083fcec
commit d572dcb272
5 changed files with 76 additions and 1 deletions

View File

@@ -9714,7 +9714,7 @@ namespace ts {
// fill in any as-yet-unresolved late-bound members.
const lateSymbols = createSymbolTable() as UnderscoreEscapedMap<TransientSymbol>;
for (const decl of symbol.declarations) {
for (const decl of symbol.declarations || emptyArray) {
const members = getMembersOfDeclaration(decl);
if (members) {
for (const member of members) {