add support for typecasts in path static evaluation

This commit is contained in:
Sebastian McKenzie 2015-06-09 22:52:00 +01:00
parent f4d7cc55c1
commit 572261f9ce

View File

@ -76,6 +76,10 @@ export function evaluate(): { confident: boolean; value: any } {
}
}
if (path.isTypeCastExpression()) {
return evaluate(path.get("expression"));
}
if (path.isIdentifier() && !path.scope.hasBinding(node.name, true)) {
if (node.name === "undefined") {
return undefined;