@@ -264,7 +264,7 @@ namespace ts {
264264 return ( isGlobalScopeAugmentation ( < ModuleDeclaration > node ) ? "__global" : `"${ moduleName } "` ) as __String ;
265265 }
266266 if ( name . kind === SyntaxKind . ComputedPropertyName ) {
267- const nameExpression = ( < ComputedPropertyName > name ) . expression ;
267+ const nameExpression = name . expression ;
268268 // treat computed property names where expression is string/numeric literal as just string/numeric literal
269269 if ( isStringOrNumericLiteral ( nameExpression ) ) {
270270 return escapeLeadingUnderscores ( nameExpression . text ) ;
@@ -459,10 +459,7 @@ namespace ts {
459459 // and this case is specially handled. Module augmentations should only be merged with original module definition
460460 // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed.
461461 if ( node . kind === SyntaxKind . JSDocTypedefTag ) Debug . assert ( isInJavaScriptFile ( node ) ) ; // We shouldn't add symbols for JSDoc nodes if not in a JS file.
462- const isJSDocTypedefInJSDocNamespace = node . kind === SyntaxKind . JSDocTypedefTag &&
463- ( node as JSDocTypedefTag ) . name &&
464- ( node as JSDocTypedefTag ) . name . kind === SyntaxKind . Identifier &&
465- ( ( node as JSDocTypedefTag ) . name as Identifier ) . isInJSDocNamespace ;
462+ const isJSDocTypedefInJSDocNamespace = isJSDocTypedefTag ( node ) && node . name && node . name . kind === SyntaxKind . Identifier && node . name . isInJSDocNamespace ;
466463 if ( ( ! isAmbientModule ( node ) && ( hasExportModifier || container . flags & NodeFlags . ExportContext ) ) || isJSDocTypedefInJSDocNamespace ) {
467464 const exportKind = symbolFlags & SymbolFlags . Value ? SymbolFlags . ExportValue : 0 ;
468465 const local = declareSymbol ( container . locals , /*parent*/ undefined , node , exportKind , symbolExcludes ) ;
@@ -527,7 +524,7 @@ namespace ts {
527524 if ( ! isIIFE ) {
528525 currentFlow = { flags : FlowFlags . Start } ;
529526 if ( containerFlags & ( ContainerFlags . IsFunctionExpression | ContainerFlags . IsObjectLiteralOrClassExpressionMethod ) ) {
530- ( < FlowStart > currentFlow ) . container = < FunctionExpression | ArrowFunction | MethodDeclaration > node ;
527+ currentFlow . container = < FunctionExpression | ArrowFunction | MethodDeclaration > node ;
531528 }
532529 }
533530 // We create a return control flow graph for IIFEs and constructors. For constructors
@@ -997,7 +994,7 @@ namespace ts {
997994 addAntecedent ( postLoopLabel , currentFlow ) ;
998995 bind ( node . initializer ) ;
999996 if ( node . initializer . kind !== SyntaxKind . VariableDeclarationList ) {
1000- bindAssignmentTargetFlow ( < Expression > node . initializer ) ;
997+ bindAssignmentTargetFlow ( node . initializer ) ;
1001998 }
1002999 bindIterativeStatement ( node . statement , postLoopLabel , preLoopLabel ) ;
10031000 addAntecedent ( preLoopLabel , currentFlow ) ;
@@ -1170,7 +1167,7 @@ namespace ts {
11701167 i ++ ;
11711168 }
11721169 const preCaseLabel = createBranchLabel ( ) ;
1173- addAntecedent ( preCaseLabel , createFlowSwitchClause ( preSwitchCaseFlow , < SwitchStatement > node . parent , clauseStart , i + 1 ) ) ;
1170+ addAntecedent ( preCaseLabel , createFlowSwitchClause ( preSwitchCaseFlow , node . parent , clauseStart , i + 1 ) ) ;
11741171 addAntecedent ( preCaseLabel , fallthroughFlow ) ;
11751172 currentFlow = finishFlowLabel ( preCaseLabel ) ;
11761173 const clause = clauses [ i ] ;
@@ -1251,13 +1248,13 @@ namespace ts {
12511248 else if ( node . kind === SyntaxKind . ObjectLiteralExpression ) {
12521249 for ( const p of ( < ObjectLiteralExpression > node ) . properties ) {
12531250 if ( p . kind === SyntaxKind . PropertyAssignment ) {
1254- bindDestructuringTargetFlow ( ( < PropertyAssignment > p ) . initializer ) ;
1251+ bindDestructuringTargetFlow ( p . initializer ) ;
12551252 }
12561253 else if ( p . kind === SyntaxKind . ShorthandPropertyAssignment ) {
1257- bindAssignmentTargetFlow ( ( < ShorthandPropertyAssignment > p ) . name ) ;
1254+ bindAssignmentTargetFlow ( p . name ) ;
12581255 }
12591256 else if ( p . kind === SyntaxKind . SpreadAssignment ) {
1260- bindAssignmentTargetFlow ( ( < SpreadAssignment > p ) . expression ) ;
1257+ bindAssignmentTargetFlow ( p . expression ) ;
12611258 }
12621259 }
12631260 }
@@ -1572,7 +1569,7 @@ namespace ts {
15721569 }
15731570
15741571 function hasExportDeclarations ( node : ModuleDeclaration | SourceFile ) : boolean {
1575- const body = node . kind === SyntaxKind . SourceFile ? node : ( < ModuleDeclaration > node ) . body ;
1572+ const body = node . kind === SyntaxKind . SourceFile ? node : node . body ;
15761573 if ( body && ( body . kind === SyntaxKind . SourceFile || body . kind === SyntaxKind . ModuleBlock ) ) {
15771574 for ( const stat of ( < BlockLike > body ) . statements ) {
15781575 if ( stat . kind === SyntaxKind . ExportDeclaration || stat . kind === SyntaxKind . ExportAssignment ) {
@@ -2210,7 +2207,7 @@ namespace ts {
22102207 function checkTypePredicate ( node : TypePredicateNode ) {
22112208 const { parameterName, type } = node ;
22122209 if ( parameterName && parameterName . kind === SyntaxKind . Identifier ) {
2213- checkStrictModeIdentifier ( parameterName as Identifier ) ;
2210+ checkStrictModeIdentifier ( parameterName ) ;
22142211 }
22152212 if ( parameterName && parameterName . kind === SyntaxKind . ThisType ) {
22162213 seenThisKeyword = true ;
@@ -2555,13 +2552,13 @@ namespace ts {
25552552 }
25562553 }
25572554
2558- checkStrictModeFunctionName ( < FunctionDeclaration > node ) ;
2555+ checkStrictModeFunctionName ( node ) ;
25592556 if ( inStrictMode ) {
25602557 checkStrictModeFunctionDeclaration ( node ) ;
25612558 bindBlockScopedDeclaration ( node , SymbolFlags . Function , SymbolFlags . FunctionExcludes ) ;
25622559 }
25632560 else {
2564- declareSymbolAndAddToSymbolTable ( < Declaration > node , SymbolFlags . Function , SymbolFlags . FunctionExcludes ) ;
2561+ declareSymbolAndAddToSymbolTable ( node , SymbolFlags . Function , SymbolFlags . FunctionExcludes ) ;
25652562 }
25662563 }
25672564
0 commit comments