Skip to content

Commit

Permalink
Instrument: Shorten code [refactor]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Aug 31, 2023
1 parent 8b49cd3 commit 21d91a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/instrument/visitors/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ function hoistSloppyFunctionDeclaration(declaration) {

// If any binding in intermediate blocks, do not hoist.
// NB This includes function declarations which will be themselves hoisted.
const originBlock = declaration.block;
let thisBlock = originBlock.parent;
let thisBlock = declaration.block.parent;
while (thisBlock !== hoistBlock) {
if (thisBlock.bindings[varName]) return;
thisBlock = thisBlock.parent;
Expand Down

0 comments on commit 21d91a3

Please sign in to comment.