fix: 迭代可选入口对非空不可调用 @@iterator 抛错并实现 IsHTMLDDA 宿主值

This commit is contained in:
2026-09-14 22:16:43 +00:00
parent 5cfd3162ba
commit 92df76565b
6 changed files with 143 additions and 16 deletions
+4 -1
View File
@@ -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
}