Skip to content

Commit

Permalink
Fix panics
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Mar 21, 2023
1 parent 7772f2c commit 766f809
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions boa_engine/src/bytecompiler/expression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ impl ByteCompiler<'_, '_> {
self.emit_opcode(Opcode::Await);
let (skip_yield, skip_yield_await) =
self.emit_opcode_with_two_operands(Opcode::AsyncGeneratorNext);
self.emit_opcode(Opcode::PushUndefined);
self.emit_opcode(Opcode::Yield);
self.emit_opcode(Opcode::GeneratorNext);
self.patch_jump(skip_yield);
Expand Down
6 changes: 1 addition & 5 deletions boa_engine/src/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,7 @@ impl Context<'_> {
return CompletionRecord::Normal(result);
}
EarlyReturnType::Yield => {
let result = self
.vm
.stack
.pop()
.expect("Yield must always return a result.");
let result = self.vm.pop();
self.vm.frame_mut().early_return = None;
return CompletionRecord::Return(result);
}
Expand Down

0 comments on commit 766f809

Please sign in to comment.