Fix handling of this&co in computed keys in arrows transform (#14005)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { template, traverse, types as t } from "@babel/core";
|
||||
import type { File } from "@babel/core";
|
||||
import type { NodePath, Visitor, Scope } from "@babel/traverse";
|
||||
import ReplaceSupers, {
|
||||
environmentVisitor,
|
||||
} from "@babel/helper-replace-supers";
|
||||
import ReplaceSupers from "@babel/helper-replace-supers";
|
||||
import environmentVisitor from "@babel/helper-environment-visitor";
|
||||
import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions";
|
||||
import type {
|
||||
Handler,
|
||||
@@ -851,7 +850,11 @@ function buildPrivateMethodDeclaration(
|
||||
);
|
||||
}
|
||||
|
||||
const thisContextVisitor = traverse.visitors.merge([
|
||||
const thisContextVisitor = traverse.visitors.merge<{
|
||||
classRef: t.Identifier;
|
||||
needsClassRef: boolean;
|
||||
innerBinding: t.Identifier;
|
||||
}>([
|
||||
{
|
||||
ThisExpression(path, state) {
|
||||
state.needsClassRef = true;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { template, traverse, types as t } from "@babel/core";
|
||||
import type { File } from "@babel/core";
|
||||
import type { NodePath, Scope, Visitor, Binding } from "@babel/traverse";
|
||||
import { environmentVisitor } from "@babel/helper-replace-supers";
|
||||
import environmentVisitor from "@babel/helper-environment-visitor";
|
||||
|
||||
const findBareSupers = traverse.visitors.merge([
|
||||
const findBareSupers = traverse.visitors.merge<NodePath<t.CallExpression>[]>([
|
||||
{
|
||||
Super(path: NodePath<t.Super>) {
|
||||
const { node, parentPath } = path;
|
||||
|
||||
Reference in New Issue
Block a user