mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: DataView 原型访问器与 ToNumber 强转序位收口
This commit is contained in:
@@ -972,8 +972,13 @@ impl Vm {
|
||||
let new_obj_val = JsValue::object(new_obj as *mut u8);
|
||||
|
||||
if ctor_obj.native_fn().is_some() {
|
||||
// native 构造器:receiver 为新对象,值传递调用。
|
||||
match self.call_function_sync(constructor, new_obj_val, &args) {
|
||||
// native 构造器:receiver 为新对象,值传递调用。newTarget 快照后置入
|
||||
// reg(255) 暴露给 native 构造器(调用后恢复原值)。
|
||||
let saved_new_target = self.regs[255];
|
||||
self.regs[255] = constructor;
|
||||
let result = self.call_function_sync(constructor, new_obj_val, &args);
|
||||
self.regs[255] = saved_new_target;
|
||||
match result {
|
||||
Ok(v) => {
|
||||
self.regs[rd] = if v.is_object() { v } else { new_obj_val };
|
||||
Ok(false)
|
||||
|
||||
Reference in New Issue
Block a user