From 21d91a38faa12b72dfe494cf4cf132d1bd4d0bbc Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Thu, 31 Aug 2023 11:18:22 +0100 Subject: [PATCH] Instrument: Shorten code [refactor] --- lib/instrument/visitors/function.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/instrument/visitors/function.js b/lib/instrument/visitors/function.js index 7186aedb..4d77e917 100644 --- a/lib/instrument/visitors/function.js +++ b/lib/instrument/visitors/function.js @@ -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;