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
@@ -99,6 +99,10 @@ impl Vm {
if self.sub_modules[sub_idx].is_generator {
return self.raise_type_error("g is not a constructor").map(|_| true);
}
// 异步函数不是构造器:`new f()` 抛 TypeError。
if self.sub_modules[sub_idx].is_async {
return self.raise_type_error("g is not a constructor").map(|_| true);
}
if self.frames.len() >= self.kernel_core.config.max_call_depth {
return Err(self.error_message_text("RangeError", "Maximum call stack size exceeded"));