From 1e31d415be179ac09667d45d11a0b83ad74ca5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 14 Apr 2021 16:00:40 -0400 Subject: [PATCH] refactor: use FunctionParent on visiting var scope (#13152) --- packages/babel-helper-hoist-variables/src/index.ts | 2 +- packages/babel-plugin-transform-block-scoping/src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-helper-hoist-variables/src/index.ts b/packages/babel-helper-hoist-variables/src/index.ts index c920b188ae31..8fc35f09b8fe 100644 --- a/packages/babel-helper-hoist-variables/src/index.ts +++ b/packages/babel-helper-hoist-variables/src/index.ts @@ -19,7 +19,7 @@ const visitor = { if (state.kind === "let") path.skip(); }, - Function(path: NodePath) { + FunctionParent(path: NodePath) { path.skip(); }, diff --git a/packages/babel-plugin-transform-block-scoping/src/index.js b/packages/babel-plugin-transform-block-scoping/src/index.js index 0a674c27b15e..33b5ac8fb502 100644 --- a/packages/babel-plugin-transform-block-scoping/src/index.js +++ b/packages/babel-plugin-transform-block-scoping/src/index.js @@ -175,7 +175,7 @@ const letReferenceBlockVisitor = traverse.visitors.merge([ state.loopDepth--; }, }, - Function(path, state) { + FunctionParent(path, state) { // References to block-scoped variables only require added closures if it's // possible for the code to run more than once -- otherwise it is safe to // simply rename the variables.