From a950ceb99e01813f57f8a11ae6b7b40d25fd720c Mon Sep 17 00:00:00 2001 From: jberg Date: Mon, 12 Aug 2019 16:32:58 -0700 Subject: [PATCH] Fix initial stack values (#851) --- modern/src/maki-interpreter/virtualMachine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modern/src/maki-interpreter/virtualMachine.js b/modern/src/maki-interpreter/virtualMachine.js index 4e6116c4..11b227ed 100644 --- a/modern/src/maki-interpreter/virtualMachine.js +++ b/modern/src/maki-interpreter/virtualMachine.js @@ -41,13 +41,13 @@ export function run({ runtime, data, system, log, debugHandler }) { // const logger = log ? printCommand : logger; // TODO: Handle disposing of this. // TODO: Handle passing in variables. - variable.hook(method.name, () => { + variable.hook(method.name, (...args) => { // Interpret is a generator that yields before each command is exectued. // `handler` is reponsible for `.next()`ing until the program execution is // complete (the generator is "done"). In production this is done // synchronously. In the debugger, if execution is paused, it's done // async. - handler(interpret(commandOffset, program, [])); + handler(interpret(commandOffset, program, args.reverse())); }); });