Fix initial stack values (#851)

This commit is contained in:
jberg 2019-08-12 16:32:58 -07:00 committed by Jordan Eldredge
parent 126fade049
commit a950ceb99e

View file

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