feat: Promise 基础子系统 + 微任务队列(resolve/reject/then/catch/finally + run() drain)

This commit is contained in:
2026-08-09 21:08:53 +08:00
parent 464712f7ba
commit 538a5670dc
11 changed files with 1265 additions and 40 deletions
+5
View File
@@ -70,6 +70,11 @@ impl Vm {
crate::generator::rewrite_generator_native(dst_ref, |value| {
self.promote_value_if_epoch_object(value, forwarding)
});
} else if src_ref.is_promise_obj() {
// Promise 状态盒深拷贝到新对象:源盒随 epoch 释放,互不共享。
crate::promise::clone_promise_native_with_rewrite(src_ref, dst_ref, |value| {
self.promote_value_if_epoch_object(value, forwarding)
});
}
dst
}