mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: 还原 instanceof 的 null handler 归一化条件并翻转单测断言
This commit is contained in:
@@ -416,9 +416,9 @@ impl Vm {
|
||||
Ok(_) => return Ok(()),
|
||||
Err(e) => return self.raise_call_error(&e).map(|_| ()),
|
||||
};
|
||||
// 仅 undefined 视为无 handler;null 非 undefined,须调用,Call(null) 抛
|
||||
// TypeError。handler 在场须可调用;调用异常原值上抛(外围 try/catch 可捕获)。
|
||||
if !has_instance_val.is_undefined() {
|
||||
// GetMethod 语义:null 与 undefined 均归一化为无 handler,走 prototype
|
||||
// 分支。handler 在场须可调用;调用异常原值上抛(外围 try/catch 可捕获)。
|
||||
if !has_instance_val.is_undefined() && !has_instance_val.is_null() {
|
||||
if !is_callable(has_instance_val) {
|
||||
return self.raise_type_error("instanceof: @@hasInstance handler is not callable");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user