test262: $262 宿主对象最小绑定 + is not defined 判定白名单化

引擎侧:绑定 $262 宿主对象(evalScript/global/gc 可用,detachArrayBuffer/
createRealm/agent 抛 not supported 而非 ReferenceError),并加入编译期
已知全局表;引用 $262.* 的测试从全量 skip 转为真实执行。

runner 侧:is not defined 不再一票吞 skip——解析错误消息中的标识符名,
仅在缺失全局白名单($262/structuredClone/queueMicrotask)内才按能力
缺失跳过;其余 is not defined 按真实失败计入,修复后应转 PASS 的
测试恢复可见。
This commit is contained in:
2026-08-16 02:47:02 +08:00
parent 1a03213390
commit 2b86cd241d
6 changed files with 304 additions and 28 deletions
+2
View File
@@ -737,6 +737,7 @@ pub fn bind_global_builtin_slots(core: &Arc<KernelCore>, session: &KernelSession
bind_stub_globals(core, session, global);
bind_bigint::bind_bigint(core, session, global);
bind_global_functions(core, session, global);
crate::test262_host::bind_test262_host(core, session, global);
let global_this = JsValue::from_js_object(global as *mut JsObject);
bind_existing_global(core, global, "globalThis", global_this);
}
@@ -825,5 +826,6 @@ pub fn init_kernel_builtins(core: &Arc<KernelCore>, session: &mut KernelSession)
bind_reflect::bind_reflect(core, session, global);
bind_global::bind_global(core, session, global);
bind_global_value(core, global, "globalThis", JsValue::from_js_object(global_ptr));
crate::test262_host::bind_test262_host(core, session, global);
session.record_snapshot();
}