Skip to content

Commit 6eb310a

Browse files
authored
Fix this binding in arrow functions in classes (#237)
1 parent 377522a commit 6eb310a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/processScript/transform.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,11 @@ export function transform(
714714
thisIsReferenced = true
715715
path.replaceWith(t.identifier(`_${uniqueId}_THIS_`))
716716
},
717-
Function: path => path.skip()
717+
Function(path) {
718+
if (path.node.type != `ArrowFunctionExpression`) {
719+
path.skip()
720+
}
721+
}
718722
}, scope)
719723

720724
if (!methodReferencesThis)

0 commit comments

Comments
 (0)