summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/GlobalObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/GlobalObject.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
index 43e1f4e15c..5190f5845c 100644
--- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
@@ -28,6 +28,7 @@
#include <LibJS/Runtime/AsyncFunctionPrototype.h>
#include <LibJS/Runtime/AsyncGeneratorFunctionConstructor.h>
#include <LibJS/Runtime/AsyncGeneratorFunctionPrototype.h>
+#include <LibJS/Runtime/AsyncGeneratorPrototype.h>
#include <LibJS/Runtime/AsyncIteratorPrototype.h>
#include <LibJS/Runtime/AtomicsObject.h>
#include <LibJS/Runtime/BigIntConstructor.h>
@@ -177,12 +178,10 @@ void GlobalObject::initialize_global_object()
JS_ENUMERATE_ITERATOR_PROTOTYPES
#undef __JS_ENUMERATE
- // %GeneratorFunction.prototype.prototype% must be initialized separately as it has no
- // companion constructor
- m_generator_prototype = heap().allocate<GeneratorPrototype>(*this, *this);
-
+ // These must be initialized separately as they have no companion constructor
m_async_from_sync_iterator_prototype = heap().allocate<AsyncFromSyncIteratorPrototype>(*this, *this);
-
+ m_async_generator_prototype = heap().allocate<AsyncGeneratorPrototype>(*this, *this);
+ m_generator_prototype = heap().allocate<GeneratorPrototype>(*this, *this);
m_intl_segments_prototype = heap().allocate<Intl::SegmentsPrototype>(*this, *this);
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
@@ -298,6 +297,9 @@ void GlobalObject::initialize_global_object()
// 27.5.1.1 Generator.prototype.constructor, https://tc39.es/ecma262/#sec-generator.prototype.constructor
m_generator_prototype->define_direct_property(vm.names.constructor, m_generator_function_prototype, Attribute::Configurable);
+ // 27.6.1.1 AsyncGenerator.prototype.constructor, https://tc39.es/ecma262/#sec-asyncgenerator-prototype-constructor
+ m_async_generator_prototype->define_direct_property(vm.names.constructor, m_async_generator_function_prototype, Attribute::Configurable);
+
m_array_prototype_values_function = &m_array_prototype->get_without_side_effects(vm.names.values).as_function();
m_date_constructor_now_function = &m_date_constructor->get_without_side_effects(vm.names.now).as_function();
m_eval_function = &get_without_side_effects(vm.names.eval).as_function();
@@ -315,8 +317,9 @@ void GlobalObject::visit_edges(Visitor& visitor)
visitor.visit(m_new_object_shape);
visitor.visit(m_new_ordinary_function_prototype_object_shape);
visitor.visit(m_proxy_constructor);
- visitor.visit(m_generator_prototype);
visitor.visit(m_async_from_sync_iterator_prototype);
+ visitor.visit(m_async_generator_prototype);
+ visitor.visit(m_generator_prototype);
visitor.visit(m_intl_segments_prototype);
visitor.visit(m_array_prototype_values_function);
visitor.visit(m_date_constructor_now_function);