feat: Promise 静态方法(all/race/allSettled/any + AggregateError)+ async test262 解锁

- Promise.all/race/allSettled/any:共享聚合核心,逐元素 C.resolve + Invoke(then),
  共享记录对象承载剩余计数/结果数组/能力闭包,元素处理器按模式结算
- AggregateError 内建(构造器 + prototype,Promise.any 拒绝路径依赖)
- 修复 capability_executor:能力已持有非 undefined 值时二次调用抛 TypeError
- test262 runner:移除 async flag 无条件 skip;解锁 asyncHelpers/promiseHelper/
  doneprintHandle harness;注入 print 捕获 + ,run() 后按 marker 判定
- 排除 await-dictionary(Promise.allKeyed/allSettledKeyed 2025 proposal)特性
- iterator 遍历辅助改 pub 供 oxide_vm 复用
This commit is contained in:
2026-08-09 23:25:36 +08:00
parent fd47cd56d0
commit 5a9a46483d
8 changed files with 798 additions and 61 deletions
+4
View File
@@ -37,6 +37,8 @@ impl Vm {
generator_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
promise_constructor: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
promise_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
aggregate_error_constructor: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
aggregate_error_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
async_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
job_queue: VecDeque::new(),
math_rng_state: 0,
@@ -122,6 +124,8 @@ impl Vm {
generator_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
promise_constructor: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
promise_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
aggregate_error_constructor: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
aggregate_error_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
async_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
job_queue: VecDeque::new(),
math_rng_state: 0,