Merge pull request #32626 from orta/fix-31312

Fixes making changes on JS imports
This commit is contained in:
Orta
2019-08-02 11:15:38 -04:00
committed by GitHub
3 changed files with 5 additions and 14 deletions

View File

@@ -29986,8 +29986,10 @@ namespace ts {
function checkAliasSymbol(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier | ExportSpecifier) {
const symbol = getSymbolOfNode(node);
const target = resolveAlias(symbol);
if (target !== unknownSymbol) {
// For external modules symbol represent local symbol for an alias.
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.
// Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have,

View File

@@ -258,4 +258,4 @@ namespace ts {
isDebugInfoEnabled = true;
}
}
}
}

View File

@@ -1,11 +0,0 @@
tests/cases/conformance/salsa/bug24658.js(1,10): error TS2440: Import declaration conflicts with local declaration of 'hurk'.
==== tests/cases/conformance/salsa/mod1.js (0 errors) ====
export var hurk = {}
==== tests/cases/conformance/salsa/bug24658.js (1 errors) ====
import { hurk } from './mod1'
~~~~
!!! error TS2440: Import declaration conflicts with local declaration of 'hurk'.
hurk.expando = 4