mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: 迭代可选入口对非空不可调用 @@iterator 抛错并实现 IsHTMLDDA 宿主值
This commit is contained in:
@@ -85,10 +85,13 @@ impl Vm {
|
||||
JsType::Symbol => 5,
|
||||
JsType::BigInt => 6,
|
||||
JsType::Object => {
|
||||
// 函数对象归为 "function"(语言类型是 object,typeof 有专属分支)。
|
||||
// 函数对象归为 "function"(语言类型是 object,typeof 有专属分支);
|
||||
// [[IsHTMLDDA]] 宿主对象按 "undefined" 报告(B.3.4,Type 仍是 object)。
|
||||
let obj = unsafe { &*val.as_js_object_ptr() };
|
||||
if obj.is_function() {
|
||||
7
|
||||
} else if obj.is_html_dda_obj() {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user