|
|
|
@ -8,10 +8,8 @@
|
|
|
|
|
use crate::{ |
|
|
|
|
builtins::{function::BuiltInFunctionObject, BuiltInObject}, |
|
|
|
|
context::intrinsics::{Intrinsics, StandardConstructor, StandardConstructors}, |
|
|
|
|
object::{JsObject, PROTOTYPE}, |
|
|
|
|
property::Attribute, |
|
|
|
|
object::JsObject, |
|
|
|
|
realm::Realm, |
|
|
|
|
symbol::JsSymbol, |
|
|
|
|
value::JsValue, |
|
|
|
|
Context, JsResult, |
|
|
|
|
}; |
|
|
|
@ -27,22 +25,17 @@ impl IntrinsicObject for AsyncGeneratorFunction {
|
|
|
|
|
fn init(realm: &Realm) { |
|
|
|
|
let _timer = Profiler::global().start_event(Self::NAME, "init"); |
|
|
|
|
|
|
|
|
|
BuiltInBuilder::from_standard_constructor::<Self>(realm) |
|
|
|
|
.inherits(Some( |
|
|
|
|
realm.intrinsics().constructors().function().prototype(), |
|
|
|
|
)) |
|
|
|
|
.constructor_attributes(Attribute::CONFIGURABLE) |
|
|
|
|
.property( |
|
|
|
|
PROTOTYPE, |
|
|
|
|
realm.intrinsics().objects().async_generator(), |
|
|
|
|
Attribute::CONFIGURABLE, |
|
|
|
|
) |
|
|
|
|
.property( |
|
|
|
|
JsSymbol::to_string_tag(), |
|
|
|
|
Self::NAME, |
|
|
|
|
Attribute::CONFIGURABLE, |
|
|
|
|
) |
|
|
|
|
.build(); |
|
|
|
|
BuiltInBuilder::from_standard_constructor_static_shape::<Self>( |
|
|
|
|
realm, |
|
|
|
|
&boa_builtins::ASYNC_GENERATOR_FUNCTION_CONSTRUCTOR_STATIC_SHAPE, |
|
|
|
|
&boa_builtins::ASYNC_GENERATOR_FUNCTION_PROTOTYPE_STATIC_SHAPE, |
|
|
|
|
) |
|
|
|
|
.inherits(Some( |
|
|
|
|
realm.intrinsics().constructors().function().prototype(), |
|
|
|
|
)) |
|
|
|
|
.property(realm.intrinsics().objects().async_generator()) |
|
|
|
|
.property(Self::NAME) |
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn get(intrinsics: &Intrinsics) -> JsObject { |
|
|
|
|