From fa34aa9f6a4c5976aa4bf9afdadede7eb3dedf63 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Tue, 7 Jul 2020 13:45:47 -0500 Subject: [PATCH] Remove target global from executor Just get it from thread --- src/compiler/execute.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/compiler/execute.js b/src/compiler/execute.js index 050f4a51..6b073509 100644 --- a/src/compiler/execute.js +++ b/src/compiler/execute.js @@ -21,7 +21,7 @@ const endCall = () => { * @returns {Array} A list of threads that were started. */ const startHats = (requestedHat, optMatchFields) => { - const threads = target.runtime.startHats(requestedHat, optMatchFields, undefined); + const threads = thread.target.runtime.startHats(requestedHat, optMatchFields, undefined); return threads; }; @@ -169,7 +169,7 @@ const compare = (v1, v2) => { */ const ioQuery = (device, func, args) => { // We will assume that the device always exists. - const devObject = target.runtime.ioDevices[device]; + const devObject = thread.target.runtime.ioDevices[device]; return devObject[func].apply(devObject, args); }; @@ -310,11 +310,6 @@ const mod = (n, modulus) => { * @type {Thread} */ var thread; -/** - * The target of the current thread. - * @type {Target} - */ -var target; /** * Step a compiled thread. @@ -322,7 +317,6 @@ var target; */ const execute = (_thread) => { thread = _thread; - target = thread.target; var r = _thread.generator.next(); if (r.done) {