feat: compiler/test262 runner 接线 + 模块顶层 this 绑定

- Compiler::compile_module:Emitter::emit_program_module → 统一 IR 管线(DCE/regalloc/lower/flatten)
- CompiledModule.is_es_module:VM run 时模块顶层 this=undefined(脚本仍为全局对象)
- 全局注册 __moduleLinkGet
- test262 runner:Test262ModuleLoader(相对路径解析 + import attributes 判定 json/text/bytes),is_module 走 compile_module
This commit is contained in:
2026-08-12 17:37:24 +08:00
parent b32d525141
commit df23fdff39
8 changed files with 92 additions and 7 deletions
+1
View File
@@ -97,6 +97,7 @@ pub fn lower(f: &IRFunction) -> Result<CompiledModule, String> {
upvalue_captures: f.upvalue_captures.clone(),
cells_needed: f.cells_needed,
flat_id: 0,
is_es_module: false,
})
}