fix: NEW_SPREAD/SUPER_SPREAD 构造深递归统一走压帧入口可捕获深度检查
收敛后普通 NEW/SUPER 深递归经 push_bytecode_frame 深度检查抛可捕获 RangeError,而 NEW_SPREAD/SUPER_SPREAD 仍保留显式引擎 Err(不可捕获), 构造路径行为分叉。删除两处显式检查,交由统一入口处理:spread 变体与 普通路径一致抛可捕获 RangeError。补浅深度配置下 NEW/NEW_SPREAD 深递归 try/catch 可捕获断言(普通 NEW 作对照锚点)。
This commit is contained in:
@@ -833,9 +833,6 @@ impl Vm {
|
||||
{
|
||||
return self.raise_type_error("g is not a constructor").map(|_| true);
|
||||
}
|
||||
if self.frames.len() >= self.kernel_core.config.max_call_depth {
|
||||
return Err(self.error_message_text("RangeError", "Maximum call stack size exceeded"));
|
||||
}
|
||||
let this_value = if ctor_obj.is_derived_constructor() {
|
||||
JsValue::undefined()
|
||||
} else {
|
||||
@@ -926,9 +923,6 @@ impl Vm {
|
||||
}
|
||||
Ok(false)
|
||||
} else if super_obj.sub_module_index() > 0 {
|
||||
if self.frames.len() >= self.kernel_core.config.max_call_depth {
|
||||
return Err(self.error_message_text("RangeError", "Maximum call stack size exceeded"));
|
||||
}
|
||||
self.push_bytecode_frame(
|
||||
super_ctor,
|
||||
derived_this,
|
||||
|
||||
Reference in New Issue
Block a user