@@ -60,7 +60,6 @@ import {
60
60
getStrictOptionValue ,
61
61
getTextOfNode ,
62
62
hasDecorators ,
63
- hasStaticModifier ,
64
63
hasSyntacticModifier ,
65
64
HeritageClause ,
66
65
Identifier ,
@@ -266,7 +265,6 @@ export function transformTypeScript(context: TransformationContext) {
266
265
let currentNamespaceContainerName : Identifier ;
267
266
let currentLexicalScope : SourceFile | Block | ModuleBlock | CaseBlock ;
268
267
let currentScopeFirstDeclarationsOfName : Map < __String , Node > | undefined ;
269
- let currentClassHasParameterProperties : boolean | undefined ;
270
268
271
269
/**
272
270
* Keeps track of whether expression substitution has been enabled for specific edge cases.
@@ -323,7 +321,6 @@ export function transformTypeScript(context: TransformationContext) {
323
321
// Save state
324
322
const savedCurrentScope = currentLexicalScope ;
325
323
const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName ;
326
- const savedCurrentClassHasParameterProperties = currentClassHasParameterProperties ;
327
324
328
325
// Handle state changes before visiting a node.
329
326
onBeforeVisitNode ( node ) ;
@@ -336,7 +333,6 @@ export function transformTypeScript(context: TransformationContext) {
336
333
}
337
334
338
335
currentLexicalScope = savedCurrentScope ;
339
- currentClassHasParameterProperties = savedCurrentClassHasParameterProperties ;
340
336
return visited ;
341
337
}
342
338
@@ -1239,10 +1235,8 @@ export function transformTypeScript(context: TransformationContext) {
1239
1235
function visitPropertyNameOfClassElement ( member : ClassElement ) : PropertyName {
1240
1236
const name = member . name ! ;
1241
1237
// Computed property names need to be transformed into a hoisted variable when they are used more than once.
1242
- // The names are used more than once when:
1243
- // - the property is non-static and its initializer is moved to the constructor (when there are parameter property assignments).
1244
- // - the property has a decorator.
1245
- if ( isComputedPropertyName ( name ) && ( ( ! hasStaticModifier ( member ) && currentClassHasParameterProperties ) || hasDecorators ( member ) && legacyDecorators ) ) {
1238
+ // The names are used more than once when the property has a decorator.
1239
+ if ( legacyDecorators && isComputedPropertyName ( name ) && hasDecorators ( member ) ) {
1246
1240
const expression = visitNode ( name . expression , visitor , isExpression ) ;
1247
1241
Debug . assert ( expression ) ;
1248
1242
const innerExpression = skipPartiallyEmittedExpressions ( expression ) ;
0 commit comments