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())); }); });