diff --git a/packages/babel-helper-replace-supers/src/index.js b/packages/babel-helper-replace-supers/src/index.js index 8f1457c7a33a..3a8d7243b712 100644 --- a/packages/babel-helper-replace-supers/src/index.js +++ b/packages/babel-helper-replace-supers/src/index.js @@ -45,7 +45,7 @@ export function skipAllButComputedKey(path: NodePath) { // For perf reasons, the environmentVisitor will be traversed with `{ noScope: true }`, which means `path.scope` is undefined. // Avoid using `path.scope` here export const environmentVisitor = { - "StaticBlock|ClassPrivateProperty|TypeAnnotation"(path: NodePath) { + [`${t.StaticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path: NodePath) { path.skip(); },