From 356a4e7880f885ab21f002ae699304a762e2458a Mon Sep 17 00:00:00 2001 From: Katie Broida Date: Tue, 29 Jan 2019 10:47:54 -0500 Subject: [PATCH] Declare const once to be resused in for loop --- src/engine/runtime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 89beb4ace..7266b2736 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1461,6 +1461,8 @@ class Runtime extends EventEmitter { } const instance = this; const newThreads = []; + // Look up metadata for the relevant hat. + const hatMeta = instance._hats[requestedHatOpcode]; for (const opts in optMatchFields) { if (!optMatchFields.hasOwnProperty(opts)) continue; @@ -1507,8 +1509,6 @@ class Runtime extends EventEmitter { } } - // Look up metadata for the relevant hat. - const hatMeta = instance._hats[requestedHatOpcode]; if (hatMeta.restartExistingThreads) { // If `restartExistingThreads` is true, we should stop // any existing threads starting with the top block.