fix: 修复 NEW_EXPRESSION 异常未进入 unwind

This commit is contained in:
2026-06-08 23:06:43 +08:00
parent 95f5caf3bb
commit be199ca077
2 changed files with 33 additions and 4 deletions
+18
View File
@@ -106,3 +106,21 @@ fn regression_vm_step_limit_is_configurable() {
"expected configurable step limit error, got: {result}"
);
}
#[test]
fn regression_new_expression_native_constructor_error_is_catchable() {
assert_eq!(
eval("try { new RegExp('['); 0 } catch (e) { 1 }"),
"1",
"expected native constructor error to enter catch"
);
}
#[test]
fn regression_new_expression_bytecode_constructor_error_is_catchable() {
assert_eq!(
eval("try { function C() {} new C(); 0 } catch (e) { 1 }"),
"1",
"expected bytecode constructor capability error to enter catch"
);
}