Use hasProperty instead

This commit is contained in:
unknown 2015-03-06 22:56:59 +01:00
parent b4d723217e
commit 129ef7222c

View file

@ -9160,7 +9160,7 @@ module ts {
else {
var identifierName = (<Identifier>catchClause.variableDeclaration.name).text;
var locals = catchClause.block.locals;
if (locals && locals[identifierName]) {
if (locals && hasProperty(locals, identifierName)) {
var localSymbol = locals[identifierName]
if (localSymbol && (localSymbol.flags & SymbolFlags.BlockScopedVariable) !== 0) {
grammarErrorOnNode(localSymbol.valueDeclaration, Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, identifierName);