Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Mar 24, 2022
1 parent b35e893 commit 8f8ccae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions packages/babel-helper-environment-visitor/src/index.ts
Expand Up @@ -12,16 +12,16 @@ export function skipAllButComputedKey(
}
}

export function requeueComputedKeyAndDecorator(
export function requeueComputedKeyAndDecorators(
path: NodePath<t.Method | t.Property>,
) {
const { context } = path;
const { context, node } = path;
//@ts-ignore ClassPrivateProperty does not have computed
if (path.node.computed) {
if (node.computed) {
// requeue the computed key
context.maybeQueue(path.get("key"));
}
if (path.node.decorators) {
if (node.decorators) {
for (const decorator of path.get("decorators")) {
// requeue the decorators
context.maybeQueue(decorator);
Expand All @@ -40,14 +40,14 @@ export default {
} else {
path.skip();
if (path.isMethod()) {
requeueComputedKeyAndDecorator(path);
requeueComputedKeyAndDecorators(path);
}
}
},
"ClassProperty|ClassPrivateProperty"(
path: NodePath<t.ClassProperty | t.ClassPrivateProperty>,
) {
path.skip();
requeueComputedKeyAndDecorator(path);
requeueComputedKeyAndDecorators(path);
},
} as Visitor<unknown>;
4 changes: 2 additions & 2 deletions packages/babel-traverse/src/scope/lib/renamer.ts
Expand Up @@ -8,7 +8,7 @@ import {
variableDeclarator,
} from "@babel/types";
import type { Visitor } from "../../types";
import { requeueComputedKeyAndDecorator } from "@babel/helper-environment-visitor";
import { requeueComputedKeyAndDecorators } from "@babel/helper-environment-visitor";

const renameVisitor: Visitor<Renamer> = {
ReferencedIdentifier({ node }, state) {
Expand All @@ -26,7 +26,7 @@ const renameVisitor: Visitor<Renamer> = {
) {
path.skip();
if (path.isMethod()) {
requeueComputedKeyAndDecorator(path);
requeueComputedKeyAndDecorators(path);
}
}
},
Expand Down

0 comments on commit 8f8ccae

Please sign in to comment.