feat: async/await 语法支持(AWAIT 帧快照挂起/恢复 + 微任务驱动 + AsyncFunction intrinsics)

This commit is contained in:
爱特每羊队
2026-08-09 22:02:15 +08:00
parent dcbe3d9320
commit 0d9e6eabc9
28 changed files with 1055 additions and 28 deletions
+4
View File
@@ -116,6 +116,10 @@ impl Vm {
if self.sub_modules[sub_idx].is_generator {
return self.create_generator_object(callee, receiver, args);
}
// 异步函数调用返回 capability promise,立即同步执行 body 到首个 await。
if self.sub_modules[sub_idx].is_async {
return self.create_async_object(callee, receiver, args);
}
self.native_call_depth += 1;
let subs = Arc::clone(&self.sub_modules);