@@ -349,17 +349,17 @@ 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 ) || set ( symbolTable , name , createSymbol ( SymbolFlags . None , name ) ) ;
353353
354354 if ( name && ( includes & SymbolFlags . Classifiable ) ) {
355- classifiableNames [ name ] = name ;
355+ classifiableNames . set ( name , name ) ;
356356 }
357357
358358 if ( symbol . flags & excludes ) {
359359 if ( symbol . isReplaceableByMethod ) {
360360 // Javascript constructor-declared symbols can be discarded in favor of
361361 // prototype symbols like methods.
362- symbol = symbolTable [ name ] = createSymbol ( SymbolFlags . None , name ) ;
362+ symbol = set ( symbolTable , name , createSymbol ( SymbolFlags . None , name ) ) ;
363363 }
364364 else {
365365 if ( node . name ) {
@@ -1570,7 +1570,7 @@ namespace ts {
15701570 const typeLiteralSymbol = createSymbol ( SymbolFlags . TypeLiteral , "__type" ) ;
15711571 addDeclarationToSymbol ( typeLiteralSymbol , node , SymbolFlags . TypeLiteral ) ;
15721572 typeLiteralSymbol . members = createMap < Symbol > ( ) ;
1573- typeLiteralSymbol . members [ symbol . name ] = symbol ;
1573+ typeLiteralSymbol . members . set ( symbol . name , symbol ) ;
15741574 }
15751575
15761576 function bindObjectLiteralExpression ( node : ObjectLiteralExpression ) {
@@ -1601,9 +1601,9 @@ namespace ts {
16011601 ? ElementKind . Property
16021602 : ElementKind . Accessor ;
16031603
1604- const existingKind = seen [ identifier . text ] ;
1604+ const existingKind = seen . get ( identifier . text ) ;
16051605 if ( ! existingKind ) {
1606- seen [ identifier . text ] = currentKind ;
1606+ seen . set ( identifier . text , currentKind ) ;
16071607 continue ;
16081608 }
16091609
@@ -2208,7 +2208,7 @@ namespace ts {
22082208 constructorFunction . parent = classPrototype ;
22092209 classPrototype . parent = leftSideOfAssignment ;
22102210
2211- const funcSymbol = container . locals [ constructorFunction . text ] ;
2211+ const funcSymbol = container . locals . get ( constructorFunction . text ) ;
22122212 if ( ! funcSymbol || ! ( funcSymbol . flags & SymbolFlags . Function || isDeclarationOfFunctionExpression ( funcSymbol ) ) ) {
22132213 return ;
22142214 }
@@ -2239,7 +2239,7 @@ namespace ts {
22392239 bindAnonymousDeclaration ( node , SymbolFlags . Class , bindingName ) ;
22402240 // Add name of class expression into the map for semantic classifier
22412241 if ( node . name ) {
2242- classifiableNames [ node . name . text ] = node . name . text ;
2242+ classifiableNames . set ( node . name . text , node . name . text ) ;
22432243 }
22442244 }
22452245
@@ -2255,14 +2255,14 @@ namespace ts {
22552255 // module might have an exported variable called 'prototype'. We can't allow that as
22562256 // that would clash with the built-in 'prototype' for the class.
22572257 const prototypeSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Prototype , "prototype" ) ;
2258- if ( symbol . exports [ prototypeSymbol . name ] ) {
2258+ const symbolExport = symbol . exports . get ( prototypeSymbol . name ) ;
2259+ if ( symbolExport ) {
22592260 if ( node . name ) {
22602261 node . name . parent = node ;
22612262 }
2262- file . bindDiagnostics . push ( createDiagnosticForNode ( symbol . exports [ prototypeSymbol . name ] . declarations [ 0 ] ,
2263- Diagnostics . Duplicate_identifier_0 , prototypeSymbol . name ) ) ;
2263+ file . bindDiagnostics . push ( createDiagnosticForNode ( symbolExport . declarations [ 0 ] , Diagnostics . Duplicate_identifier_0 , prototypeSymbol . name ) ) ;
22642264 }
2265- symbol . exports [ prototypeSymbol . name ] = prototypeSymbol ;
2265+ symbol . exports . set ( prototypeSymbol . name , prototypeSymbol ) ;
22662266 prototypeSymbol . parent = symbol ;
22672267 }
22682268
0 commit comments