Check if container has locals before looking up properties

This commit is contained in:
Mohamed Hegazy
2017-04-17 16:26:49 -07:00
parent 4e29b1883d
commit b7c416cdeb
4 changed files with 50 additions and 1 deletions

View File

@@ -2401,7 +2401,7 @@ namespace ts {
}
function lookupSymbolForName(name: string) {
return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || container.locals.get(name);
return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || (container.locals && container.locals.get(name));
}
function bindPropertyAssignment(functionName: string, propertyAccessExpression: PropertyAccessExpression, isPrototypeProperty: boolean) {