mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Use hasProperty instead
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user