Skip to content

Commit 04aa477

Browse files
author
Joseph Watts
committed
Fix broken tests
Signed-off-by: Joseph Watts <[email protected]>
1 parent 31ac197 commit 04aa477

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/compiler/binder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,6 +3308,11 @@ namespace ts {
33083308
transformFlags |= TransformFlags.AssertTypeScript;
33093309
}
33103310

3311+
// Hoisted variables related to class properties should live within the TypeScript class wrapper.
3312+
if (isComputedPropertyName(node.name) || (hasStaticModifier(node) && node.initializer)) {
3313+
transformFlags |= TransformFlags.ContainsTypeScriptClassSyntax;
3314+
}
3315+
33113316
node.transformFlags = transformFlags | TransformFlags.HasComputedFlags;
33123317
return transformFlags & ~TransformFlags.NodeExcludes;
33133318
}

src/compiler/transformers/esnext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ namespace ts {
12571257
}
12581258

12591259
function substitutePropertyAccessExpression(node: PropertyAccessExpression) {
1260-
if (node.expression.kind === SyntaxKind.SuperKeyword) {
1260+
if (enclosingSuperContainerFlags && node.expression.kind === SyntaxKind.SuperKeyword) {
12611261
return setTextRange(
12621262
createPropertyAccess(
12631263
createFileLevelUniqueName("_super"),
@@ -1269,7 +1269,7 @@ namespace ts {
12691269
}
12701270

12711271
function substituteElementAccessExpression(node: ElementAccessExpression) {
1272-
if (node.expression.kind === SyntaxKind.SuperKeyword) {
1272+
if (enclosingSuperContainerFlags && node.expression.kind === SyntaxKind.SuperKeyword) {
12731273
return createSuperElementAccessInAsyncMethod(
12741274
node.argumentExpression,
12751275
node

0 commit comments

Comments
 (0)