Fix throw %!e

This commit is contained in:
Andrew Morris
2023-07-06 14:27:01 +10:00
parent 262ac430f4
commit fcc140c46c
3 changed files with 23 additions and 17 deletions

View File

@@ -484,6 +484,17 @@ impl StackFrameTrait for BytecodeStackFrame {
Throw => {
return match self.decoder.peek_type() {
BytecodeType::TakeRegister => {
self.decoder.decode_type();
// Avoid the void->undefined conversion here
let error = take(&mut self.registers[self.decoder.decode_register_index().unwrap()]);
match error {
Val::Void => Ok(FrameStepOk::Continue),
_ => Err(error),
}
}
BytecodeType::Register => {
self.decoder.decode_type();