refactor: use FunctionParent on visiting var scope (#13152)

This commit is contained in:
Huáng Jùnliàng 2021-04-14 16:00:40 -04:00 committed by GitHub
parent d24bd7ce5c
commit 1e31d415be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ const visitor = {
if (state.kind === "let") path.skip(); if (state.kind === "let") path.skip();
}, },
Function(path: NodePath) { FunctionParent(path: NodePath) {
path.skip(); path.skip();
}, },

View File

@ -175,7 +175,7 @@ const letReferenceBlockVisitor = traverse.visitors.merge([
state.loopDepth--; state.loopDepth--;
}, },
}, },
Function(path, state) { FunctionParent(path, state) {
// References to block-scoped variables only require added closures if it's // 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 // possible for the code to run more than once -- otherwise it is safe to
// simply rename the variables. // simply rename the variables.