Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/zapcode-core/src/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,10 @@ impl Vm {
return Ok(false);
}

// The callback just returned — collect its result from the stack
let callback_result = self.pop().unwrap_or(Value::Undefined);
// The callback just returned — collect its result from the stack.
// The compiler always emits PushUndefined+Return for implicit returns,
// so an empty stack here indicates a VM bug.
let callback_result = self.pop()?;

// Unwrap internal promise values: async callbacks return
// {__promise__: true, status: "resolved", value: X} or {status: "rejected", ...}.
Expand Down
Loading