From 44b13ee475cb9dac0a773d6db7593e759cb4156b Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Wed, 31 Jul 2019 14:34:21 -0400 Subject: [PATCH] Don't exclusively check for just JS but scope down the check to not include the expando'd objects --- src/compiler/checker.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 02b6e9913e..c823b066d4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -29974,9 +29974,8 @@ namespace ts { const symbol = getSymbolOfNode(node); const target = resolveAlias(symbol); - const shouldSkipWithJSRequireTargets = !isInJSFile(node) && moduleKind !== ModuleKind.ES2015; - - if (shouldSkipWithJSRequireTargets && target !== unknownSymbol) { + const shouldSkipWithJSExpandoTargets = symbol.flags & SymbolFlags.Assignment; + if (!shouldSkipWithJSExpandoTargets && target !== unknownSymbol) { // For external modules symbol represents local symbol for an alias. // This local symbol will merge any other local declarations (excluding other aliases) // and symbol.flags will contains combined representation for all merged declaration.