fix: 修复 throw_err 宏未支持 SyntaxError 问题

This commit is contained in:
2026-06-07 23:29:10 +08:00
parent 0285a71239
commit 531d1f2ba0
+9
View File
@@ -65,6 +65,15 @@ macro_rules! throw_err {
Err(e) => return Err(e), Err(e) => return Err(e),
} }
}}; }};
($self:ident, SyntaxError, $msg:expr) => {{
let error = crate::builtins::error::create_syntax_error($self, $msg);
$self.exception_value = Some(error);
$self.pending_error_kind = Some("SyntaxError");
match $self.unwind() {
Ok(()) => continue,
Err(e) => return Err(e),
}
}};
} }
pub struct CallFrame { pub struct CallFrame {