@@ -349,17 +349,20 @@ namespace ts {
349349 // Otherwise, we'll be merging into a compatible existing symbol (for example when
350350 // you have multiple 'vars' with the same name in the same container). In this case
351351 // just add this node into the declarations list of the symbol.
352- symbol = symbolTable [ name ] || ( symbolTable [ name ] = createSymbol ( SymbolFlags . None , name ) ) ;
352+ symbol = symbolTable . get ( name ) ;
353+ if ( ! symbol ) {
354+ symbolTable . set ( name , symbol = createSymbol ( SymbolFlags . None , name ) ) ;
355+ }
353356
354357 if ( name && ( includes & SymbolFlags . Classifiable ) ) {
355- classifiableNames [ name ] = name ;
358+ classifiableNames . set ( name , name ) ;
356359 }
357360
358361 if ( symbol . flags & excludes ) {
359362 if ( symbol . isReplaceableByMethod ) {
360363 // Javascript constructor-declared symbols can be discarded in favor of
361364 // prototype symbols like methods.
362- symbol = symbolTable [ name ] = createSymbol ( SymbolFlags . None , name ) ;
365+ symbolTable . set ( name , symbol = createSymbol ( SymbolFlags . None , name ) ) ;
363366 }
364367 else {
365368 if ( node . name ) {
@@ -1570,7 +1573,7 @@ namespace ts {
15701573 const typeLiteralSymbol = createSymbol ( SymbolFlags . TypeLiteral , "__type" ) ;
15711574 addDeclarationToSymbol ( typeLiteralSymbol , node , SymbolFlags . TypeLiteral ) ;
15721575 typeLiteralSymbol . members = createMap < Symbol > ( ) ;
1573- typeLiteralSymbol . members [ symbol . name ] = symbol ;
1576+ typeLiteralSymbol . members . set ( symbol . name , symbol ) ;
15741577 }
15751578
15761579 function bindObjectLiteralExpression ( node : ObjectLiteralExpression ) {
@@ -1601,9 +1604,9 @@ namespace ts {
16011604 ? ElementKind . Property
16021605 : ElementKind . Accessor ;
16031606
1604- const existingKind = seen [ identifier . text ] ;
1607+ const existingKind = seen . get ( identifier . text ) ;
16051608 if ( ! existingKind ) {
1606- seen [ identifier . text ] = currentKind ;
1609+ seen . set ( identifier . text , currentKind ) ;
16071610 continue ;
16081611 }
16091612
@@ -2208,7 +2211,7 @@ namespace ts {
22082211 constructorFunction . parent = classPrototype ;
22092212 classPrototype . parent = leftSideOfAssignment ;
22102213
2211- const funcSymbol = container . locals [ constructorFunction . text ] ;
2214+ const funcSymbol = container . locals . get ( constructorFunction . text ) ;
22122215 if ( ! funcSymbol || ! ( funcSymbol . flags & SymbolFlags . Function || isDeclarationOfFunctionExpression ( funcSymbol ) ) ) {
22132216 return ;
22142217 }
@@ -2239,7 +2242,7 @@ namespace ts {
22392242 bindAnonymousDeclaration ( node , SymbolFlags . Class , bindingName ) ;
22402243 // Add name of class expression into the map for semantic classifier
22412244 if ( node . name ) {
2242- classifiableNames [ node . name . text ] = node . name . text ;
2245+ classifiableNames . set ( node . name . text , node . name . text ) ;
22432246 }
22442247 }
22452248
@@ -2255,14 +2258,14 @@ namespace ts {
22552258 // module might have an exported variable called 'prototype'. We can't allow that as
22562259 // that would clash with the built-in 'prototype' for the class.
22572260 const prototypeSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Prototype , "prototype" ) ;
2258- if ( symbol . exports [ prototypeSymbol . name ] ) {
2261+ const symbolExport = symbol . exports . get ( prototypeSymbol . name ) ;
2262+ if ( symbolExport ) {
22592263 if ( node . name ) {
22602264 node . name . parent = node ;
22612265 }
2262- file . bindDiagnostics . push ( createDiagnosticForNode ( symbol . exports [ prototypeSymbol . name ] . declarations [ 0 ] ,
2263- Diagnostics . Duplicate_identifier_0 , prototypeSymbol . name ) ) ;
2266+ file . bindDiagnostics . push ( createDiagnosticForNode ( symbolExport . declarations [ 0 ] , Diagnostics . Duplicate_identifier_0 , prototypeSymbol . name ) ) ;
22642267 }
2265- symbol . exports [ prototypeSymbol . name ] = prototypeSymbol ;
2268+ symbol . exports . set ( prototypeSymbol . name , prototypeSymbol ) ;
22662269 prototypeSymbol . parent = symbol ;
22672270 }
22682271
0 commit comments