@@ -135,7 +135,7 @@ namespace ts {
135135 options = opts ;
136136 languageVersion = getEmitScriptTarget ( options ) ;
137137 inStrictMode = ! ! file . externalModuleIndicator ;
138- classifiableNames = { } ;
138+ classifiableNames = createMap < string > ( ) ;
139139 symbolCount = 0 ;
140140
141141 Symbol = objectAllocator . getSymbolConstructor ( ) ;
@@ -183,11 +183,11 @@ namespace ts {
183183 symbol . declarations . push ( node ) ;
184184
185185 if ( symbolFlags & SymbolFlags . HasExports && ! symbol . exports ) {
186- symbol . exports = { } ;
186+ symbol . exports = createMap < Symbol > ( ) ;
187187 }
188188
189189 if ( symbolFlags & SymbolFlags . HasMembers && ! symbol . members ) {
190- symbol . members = { } ;
190+ symbol . members = createMap < Symbol > ( ) ;
191191 }
192192
193193 if ( symbolFlags & SymbolFlags . Value ) {
@@ -318,9 +318,7 @@ namespace ts {
318318 // Otherwise, we'll be merging into a compatible existing symbol (for example when
319319 // you have multiple 'vars' with the same name in the same container). In this case
320320 // just add this node into the declarations list of the symbol.
321- symbol = hasProperty ( symbolTable , name )
322- ? symbolTable [ name ]
323- : ( symbolTable [ name ] = createSymbol ( SymbolFlags . None , name ) ) ;
321+ symbol = symbolTable [ name ] || ( symbolTable [ name ] = createSymbol ( SymbolFlags . None , name ) ) ;
324322
325323 if ( name && ( includes & SymbolFlags . Classifiable ) ) {
326324 classifiableNames [ name ] = name ;
@@ -434,7 +432,7 @@ namespace ts {
434432 if ( containerFlags & ContainerFlags . IsContainer ) {
435433 container = blockScopeContainer = node ;
436434 if ( containerFlags & ContainerFlags . HasLocals ) {
437- container . locals = { } ;
435+ container . locals = createMap < Symbol > ( ) ;
438436 }
439437 addToContainerChain ( container ) ;
440438 }
@@ -1399,7 +1397,8 @@ namespace ts {
13991397
14001398 const typeLiteralSymbol = createSymbol ( SymbolFlags . TypeLiteral , "__type" ) ;
14011399 addDeclarationToSymbol ( typeLiteralSymbol , node , SymbolFlags . TypeLiteral ) ;
1402- typeLiteralSymbol . members = { [ symbol . name ] : symbol } ;
1400+ typeLiteralSymbol . members = createMap < Symbol > ( ) ;
1401+ typeLiteralSymbol . members [ symbol . name ] = symbol ;
14031402 }
14041403
14051404 function bindObjectLiteralExpression ( node : ObjectLiteralExpression ) {
@@ -1409,7 +1408,7 @@ namespace ts {
14091408 }
14101409
14111410 if ( inStrictMode ) {
1412- const seen : Map < ElementKind > = { } ;
1411+ const seen = createMap < ElementKind > ( ) ;
14131412
14141413 for ( const prop of node . properties ) {
14151414 if ( prop . name . kind !== SyntaxKind . Identifier ) {
@@ -1465,7 +1464,7 @@ namespace ts {
14651464 // fall through.
14661465 default :
14671466 if ( ! blockScopeContainer . locals ) {
1468- blockScopeContainer . locals = { } ;
1467+ blockScopeContainer . locals = createMap < Symbol > ( ) ;
14691468 addToContainerChain ( blockScopeContainer ) ;
14701469 }
14711470 declareSymbol ( blockScopeContainer . locals , undefined , node , symbolFlags , symbolExcludes ) ;
@@ -1924,7 +1923,7 @@ namespace ts {
19241923 }
19251924 }
19261925
1927- file . symbol . globalExports = file . symbol . globalExports || { } ;
1926+ file . symbol . globalExports = file . symbol . globalExports || createMap < Symbol > ( ) ;
19281927 declareSymbol ( file . symbol . globalExports , file . symbol , node , SymbolFlags . Alias , SymbolFlags . AliasExcludes ) ;
19291928 }
19301929
@@ -1977,7 +1976,7 @@ namespace ts {
19771976 else {
19781977 return ;
19791978 }
1980- assignee . symbol . members = assignee . symbol . members || { } ;
1979+ assignee . symbol . members = assignee . symbol . members || createMap < Symbol > ( ) ;
19811980 // It's acceptable for multiple 'this' assignments of the same identifier to occur
19821981 declareSymbol ( assignee . symbol . members , assignee . symbol , node , SymbolFlags . Property , SymbolFlags . PropertyExcludes & ~ SymbolFlags . Property ) ;
19831982 }
@@ -2003,7 +2002,7 @@ namespace ts {
20032002
20042003 // Set up the members collection if it doesn't exist already
20052004 if ( ! funcSymbol . members ) {
2006- funcSymbol . members = { } ;
2005+ funcSymbol . members = createMap < Symbol > ( ) ;
20072006 }
20082007
20092008 // Declare the method/property
@@ -2052,7 +2051,7 @@ namespace ts {
20522051 // module might have an exported variable called 'prototype'. We can't allow that as
20532052 // that would clash with the built-in 'prototype' for the class.
20542053 const prototypeSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Prototype , "prototype" ) ;
2055- if ( hasProperty ( symbol . exports , prototypeSymbol . name ) ) {
2054+ if ( symbol . exports [ prototypeSymbol . name ] ) {
20562055 if ( node . name ) {
20572056 node . name . parent = node ;
20582057 }
0 commit comments