@@ -346,7 +346,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
346
346
} ;
347
347
348
348
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 ) {
350
350
if ( node . locals && hasProperty ( node . locals , name ) ) {
351
351
// We conservatively include alias symbols to cover cases where they're emitted as locals
352
352
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
1529
1529
return ;
1530
1530
}
1531
1531
}
1532
- else if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . BodyScopedClassBinding ) {
1532
+ else if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . SelfReferenceInDecoratedClass ) {
1533
1533
// Due to the emit for class decorators, any reference to the class from inside of the class body
1534
1534
// must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
1535
1535
// behavior of class names in ES6.
@@ -1915,9 +1915,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1915
1915
1916
1916
if ( multiLine ) {
1917
1917
decreaseIndent ( ) ;
1918
- if ( ! compilerOptions . transformCompatibleEmit ) {
1919
- writeLine ( ) ;
1920
- }
1921
1918
}
1922
1919
1923
1920
write ( ")" ) ;
@@ -2237,7 +2234,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2237
2234
return forEach ( elements , e => e . kind === SyntaxKind . SpreadElementExpression ) ;
2238
2235
}
2239
2236
2240
- function skipParentheses ( node : Expression ) : Expression {
2237
+ function skipParenthesesAndAssertions ( node : Expression ) : Expression {
2241
2238
while ( node . kind === SyntaxKind . ParenthesizedExpression || node . kind === SyntaxKind . TypeAssertionExpression || node . kind === SyntaxKind . AsExpression ) {
2242
2239
node = ( < ParenthesizedExpression | AssertionExpression > node ) . expression ;
2243
2240
}
@@ -2268,7 +2265,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2268
2265
2269
2266
function emitCallWithSpread ( node : CallExpression ) {
2270
2267
let target : Expression ;
2271
- const expr = skipParentheses ( node . expression ) ;
2268
+ const expr = skipParenthesesAndAssertions ( node . expression ) ;
2272
2269
if ( expr . kind === SyntaxKind . PropertyAccessExpression ) {
2273
2270
// Target will be emitted as "this" argument
2274
2271
target = emitCallTarget ( ( < PropertyAccessExpression > expr ) . expression ) ;
@@ -4334,9 +4331,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
4334
4331
writeLine ( ) ;
4335
4332
emitStart ( restParam ) ;
4336
4333
emitNodeWithCommentsAndWithoutSourcemap ( restParam . name ) ;
4337
- write ( restIndex > 0 || ! compilerOptions . transformCompatibleEmit
4338
- ? `[${ tempName } - ${ restIndex } ] = arguments[${ tempName } ];`
4339
- : `[${ tempName } ] = arguments[${ tempName } ];` ) ;
4334
+ write ( `[${ tempName } - ${ restIndex } ] = arguments[${ tempName } ];` ) ;
4340
4335
emitEnd ( restParam ) ;
4341
4336
decreaseIndent ( ) ;
4342
4337
writeLine ( ) ;
@@ -5208,7 +5203,7 @@ const _super = (function (geti, seti) {
5208
5203
// [Example 4]
5209
5204
//
5210
5205
5211
- if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . ClassWithBodyScopedClassBinding ) {
5206
+ if ( resolver . getNodeCheckFlags ( node ) & NodeCheckFlags . DecoratedClassWithSelfReference ) {
5212
5207
decoratedClassAlias = unescapeIdentifier ( makeUniqueName ( node . name ? node . name . text : "default" ) ) ;
5213
5208
decoratedClassAliases [ getNodeId ( node ) ] = decoratedClassAlias ;
5214
5209
write ( `let ${ decoratedClassAlias } ;` ) ;
@@ -5356,7 +5351,7 @@ const _super = (function (geti, seti) {
5356
5351
const isClassExpressionWithStaticProperties = staticProperties . length > 0 && node . kind === SyntaxKind . ClassExpression ;
5357
5352
let tempVariable : Identifier ;
5358
5353
5359
- if ( isClassExpressionWithStaticProperties && compilerOptions . transformCompatibleEmit ) {
5354
+ if ( isClassExpressionWithStaticProperties ) {
5360
5355
tempVariable = createAndRecordTempVariable ( TempFlags . Auto ) ;
5361
5356
write ( "(" ) ;
5362
5357
increaseIndent ( ) ;
@@ -5393,11 +5388,6 @@ const _super = (function (geti, seti) {
5393
5388
writeLine ( ) ;
5394
5389
emitConstructor ( node , baseTypeNode ) ;
5395
5390
emitMemberFunctionsForES5AndLower ( node ) ;
5396
- if ( ! compilerOptions . transformCompatibleEmit ) {
5397
- emitPropertyDeclarations ( node , staticProperties ) ;
5398
- writeLine ( ) ;
5399
- emitDecoratorsOfClass ( node , /*decoratedClassAlias*/ undefined ) ;
5400
- }
5401
5391
writeLine ( ) ;
5402
5392
emitToken ( SyntaxKind . CloseBraceToken , node . members . end , ( ) => {
5403
5393
write ( "return " ) ;
@@ -5424,13 +5414,10 @@ const _super = (function (geti, seti) {
5424
5414
write ( "))" ) ;
5425
5415
if ( node . kind === SyntaxKind . ClassDeclaration ) {
5426
5416
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 ) ;
5432
5419
}
5433
- else if ( isClassExpressionWithStaticProperties && compilerOptions . transformCompatibleEmit ) {
5420
+ else if ( isClassExpressionWithStaticProperties ) {
5434
5421
for ( const property of staticProperties ) {
5435
5422
write ( "," ) ;
5436
5423
writeLine ( ) ;
0 commit comments