MCPcopy Create free account
hub / github.com/LadybirdBrowser/ladybird / initialize

Method initialize

Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void AsyncGeneratorPrototype::initialize(Realm& realm)
24{
25 auto& vm = this->vm();
26 Base::initialize(realm);
27 u8 attr = Attribute::Writable | Attribute::Configurable;
28 define_native_function(realm, vm.names.next, next, 1, attr);
29 define_native_function(realm, vm.names.return_, return_, 1, attr);
30 define_native_function(realm, vm.names.throw_, throw_, 1, attr);
31
32 // 27.6.1.5 AsyncGenerator.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-asyncgenerator-prototype-tostringtag
33 define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, "AsyncGenerator"_utf16_fly_string), Attribute::Configurable);
34}
35
36// 27.6.3.3 AsyncGeneratorValidate ( generator, generatorBrand ), https://tc39.es/ecma262/#sec-asyncgeneratorvalidate
37static ThrowCompletionOr<GC::Ref<AsyncGenerator>> async_generator_validate(VM& vm, Value generator, Optional<String> generator_brand)

Callers

nothing calls this directly

Calls 3

initializeFunction · 0.85
define_direct_propertyFunction · 0.85
createFunction · 0.70

Tested by

no test coverage detected