refactor: use FunctionParent on visiting var scope (#13152)
This commit is contained in:
parent
d24bd7ce5c
commit
1e31d415be
@ -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();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user