Disallow JS/non-JS merge without crashing

Note that the error location is misleading because it's reported inside
the merge step for the js initializer.
This commit is contained in:
Nathan Shively-Sanders
2018-03-08 09:49:23 -08:00
parent 239f214b1c
commit 04ceb3d9bd
6 changed files with 94 additions and 1 deletions

View File

@@ -1489,7 +1489,7 @@ namespace ts {
}
const declaration = symbol.valueDeclaration;
const e = getDeclaredJavascriptInitializer(declaration) || getAssignedJavascriptInitializer(declaration);
return e ? e.symbol : symbol;
return e && e.symbol ? e.symbol : symbol;
}
/** Get the declaration initializer, when the initializer is container-like (See getJavascriptInitializer) */