mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: for-await-of + Symbol.asyncIterator + AsyncFromSyncIterator
This commit is contained in:
@@ -242,6 +242,7 @@ pub struct BuiltinWorld {
|
||||
pub sym_to_primitive: P<JsObject>,
|
||||
pub sym_has_instance: P<JsObject>,
|
||||
pub sym_match_all: P<JsObject>,
|
||||
pub sym_async_iterator: P<JsObject>,
|
||||
pub stub_objects: Vec<P<JsObject>>,
|
||||
}
|
||||
|
||||
@@ -628,6 +629,7 @@ impl BuiltinWorld {
|
||||
BuiltinId::SymToPrimitive => &self.sym_to_primitive,
|
||||
BuiltinId::SymHasInstance => &self.sym_has_instance,
|
||||
BuiltinId::SymMatchAll => &self.sym_match_all,
|
||||
BuiltinId::SymAsyncIterator => &self.sym_async_iterator,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,6 +670,7 @@ impl BuiltinWorld {
|
||||
let sym_to_primitive = P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null()));
|
||||
let sym_has_instance = P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null()));
|
||||
let sym_match_all = P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null()));
|
||||
let sym_async_iterator = P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null()));
|
||||
let stub_objects = Vec::new();
|
||||
|
||||
let world = Self {
|
||||
@@ -739,6 +742,7 @@ impl BuiltinWorld {
|
||||
sym_to_primitive,
|
||||
sym_has_instance,
|
||||
sym_match_all,
|
||||
sym_async_iterator,
|
||||
stub_objects,
|
||||
};
|
||||
wire_builtin_world_links(&world);
|
||||
@@ -811,6 +815,7 @@ impl BuiltinWorld {
|
||||
sym_to_primitive,
|
||||
sym_has_instance,
|
||||
sym_match_all,
|
||||
sym_async_iterator,
|
||||
) = if dirty.symbol_family {
|
||||
let (symbol_proto, symbol_constructor) = make_named_pair(string_forge, shape_forge, labels, "Symbol");
|
||||
(
|
||||
@@ -824,6 +829,7 @@ impl BuiltinWorld {
|
||||
P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
|
||||
P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
|
||||
P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
|
||||
P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
@@ -837,6 +843,7 @@ impl BuiltinWorld {
|
||||
current.sym_to_primitive.clone(),
|
||||
current.sym_has_instance.clone(),
|
||||
current.sym_match_all.clone(),
|
||||
current.sym_async_iterator.clone(),
|
||||
)
|
||||
};
|
||||
|
||||
@@ -981,6 +988,7 @@ impl BuiltinWorld {
|
||||
sym_to_primitive,
|
||||
sym_has_instance,
|
||||
sym_match_all,
|
||||
sym_async_iterator,
|
||||
stub_objects,
|
||||
};
|
||||
wire_builtin_world_links(&world);
|
||||
|
||||
Reference in New Issue
Block a user