@@ -346,7 +346,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
346346 } ;
347347
348348 function isUniqueLocalName ( name : string , container : Node ) : boolean {
349- for ( let node = container ; isNodeDescendentOf ( node , container ) ; node = node . nextContainer ) {
349+ for ( let node = container ; isNodeDescendantOf ( node , container ) ; node = node . nextContainer ) {
350350 if ( node . locals && hasProperty ( node . locals , name ) ) {
351351 // We conservatively include alias symbols to cover cases where they're emitted as locals
352352 if ( node . locals [ name ] . flags & ( SymbolFlags . Value | SymbolFlags . ExportValue | SymbolFlags . Alias ) ) {
@@ -1529,7 +1529,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
15291529 return ;
15301530 }
15311531 }
1532- else if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . BodyScopedClassBinding ) {
1532+ else if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . SelfReferenceInDecoratedClass ) {
15331533 // Due to the emit for class decorators, any reference to the class from inside of the class body
15341534 // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
15351535 // behavior of class names in ES6.
@@ -1915,9 +1915,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19151915
19161916 if ( multiLine ) {
19171917 decreaseIndent ( ) ;
1918- if ( ! compilerOptions . transformCompatibleEmit ) {
1919- writeLine ( ) ;
1920- }
19211918 }
19221919
19231920 write ( ")" ) ;
@@ -2237,7 +2234,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22372234 return forEach ( elements , e => e . kind === SyntaxKind . SpreadElementExpression ) ;
22382235 }
22392236
2240- function skipParentheses ( node : Expression ) : Expression {
2237+ function skipParenthesesAndAssertions ( node : Expression ) : Expression {
22412238 while ( node . kind === SyntaxKind . ParenthesizedExpression || node . kind === SyntaxKind . TypeAssertionExpression || node . kind === SyntaxKind . AsExpression ) {
22422239 node = ( < ParenthesizedExpression | AssertionExpression > node ) . expression ;
22432240 }
@@ -2268,7 +2265,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22682265
22692266 function emitCallWithSpread ( node : CallExpression ) {
22702267 let target : Expression ;
2271- const expr = skipParentheses ( node . expression ) ;
2268+ const expr = skipParenthesesAndAssertions ( node . expression ) ;
22722269 if ( expr . kind === SyntaxKind . PropertyAccessExpression ) {
22732270 // Target will be emitted as "this" argument
22742271 target = emitCallTarget ( ( < PropertyAccessExpression > expr ) . expression ) ;
@@ -2342,7 +2339,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23422339 superCall = true ;
23432340 }
23442341 else {
2345- superCall = isSuperPropertyOrElementAccess ( expression ) ;
2342+ superCall = isSuperProperty ( expression ) ;
23462343 isAsyncMethodWithSuper = superCall && isInAsyncMethodWithSuperInES6 ( node ) ;
23472344 emit ( expression ) ;
23482345 }
@@ -4334,9 +4331,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43344331 writeLine ( ) ;
43354332 emitStart ( restParam ) ;
43364333 emitNodeWithCommentsAndWithoutSourcemap ( restParam . name ) ;
4337- write ( restIndex > 0 || ! compilerOptions . transformCompatibleEmit
4338- ? `[${ tempName } - ${ restIndex } ] = arguments[${ tempName } ];`
4339- : `[${ tempName } ] = arguments[${ tempName } ];` ) ;
4334+ write ( `[${ tempName } - ${ restIndex } ] = arguments[${ tempName } ];` ) ;
43404335 emitEnd ( restParam ) ;
43414336 decreaseIndent ( ) ;
43424337 writeLine ( ) ;
@@ -5208,7 +5203,7 @@ const _super = (function (geti, seti) {
52085203 // [Example 4]
52095204 //
52105205
5211- if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . ClassWithBodyScopedClassBinding ) {
5206+ if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . DecoratedClassWithSelfReference ) {
52125207 decoratedClassAlias = unescapeIdentifier ( makeUniqueName ( node . name ? node . name . text : "default" ) ) ;
52135208 decoratedClassAliases [ getNodeId ( node ) ] = decoratedClassAlias ;
52145209 write ( `let ${ decoratedClassAlias } ;` ) ;
@@ -5356,7 +5351,7 @@ const _super = (function (geti, seti) {
53565351 const isClassExpressionWithStaticProperties = staticProperties . length > 0 && node . kind === SyntaxKind . ClassExpression ;
53575352 let tempVariable : Identifier ;
53585353
5359- if ( isClassExpressionWithStaticProperties && compilerOptions . transformCompatibleEmit ) {
5354+ if ( isClassExpressionWithStaticProperties ) {
53605355 tempVariable = createAndRecordTempVariable ( TempFlags . Auto ) ;
53615356 write ( "(" ) ;
53625357 increaseIndent ( ) ;
@@ -5393,11 +5388,6 @@ const _super = (function (geti, seti) {
53935388 writeLine ( ) ;
53945389 emitConstructor ( node , baseTypeNode ) ;
53955390 emitMemberFunctionsForES5AndLower ( node ) ;
5396- if ( ! compilerOptions . transformCompatibleEmit ) {
5397- emitPropertyDeclarations ( node , staticProperties ) ;
5398- writeLine ( ) ;
5399- emitDecoratorsOfClass ( node , /*decoratedClassAlias*/ undefined ) ;
5400- }
54015391 writeLine ( ) ;
54025392 emitToken ( SyntaxKind . CloseBraceToken , node . members . end , ( ) => {
54035393 write ( "return " ) ;
@@ -5424,13 +5414,10 @@ const _super = (function (geti, seti) {
54245414 write ( "))" ) ;
54255415 if ( node . kind === SyntaxKind . ClassDeclaration ) {
54265416 write ( ";" ) ;
5427- if ( compilerOptions . transformCompatibleEmit ) {
5428- emitPropertyDeclarations ( node , staticProperties ) ;
5429- writeLine ( ) ;
5430- emitDecoratorsOfClass ( node , /*decoratedClassAlias*/ undefined ) ;
5431- }
5417+ emitPropertyDeclarations ( node , staticProperties ) ;
5418+ emitDecoratorsOfClass ( node , /*decoratedClassAlias*/ undefined ) ;
54325419 }
5433- else if ( isClassExpressionWithStaticProperties && compilerOptions . transformCompatibleEmit ) {
5420+ else if ( isClassExpressionWithStaticProperties ) {
54345421 for ( const property of staticProperties ) {
54355422 write ( "," ) ;
54365423 writeLine ( ) ;
0 commit comments