diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 0ba0eae4c9..cd500eb251 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -125,7 +124,7 @@ void ECMAScriptFunctionObject::initialize(GlobalObject& global_object) case FunctionKind::Async: break; case FunctionKind::AsyncGenerator: - // FIXME: Add the AsyncGeneratorObject and set it as prototype. + prototype = Object::create(global_object, global_object.async_generator_function_prototype_prototype()); break; } // 27.7.4 AsyncFunction Instances, https://tc39.es/ecma262/#sec-async-function-instances diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp index 6221af7650..c9a90f2a3f 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp @@ -250,12 +250,11 @@ ThrowCompletionOr FunctionConstructor::create_dynamic } // 34. Else if kind is asyncGenerator, then else if (kind == FunctionKind::AsyncGenerator) { - // FIXME: We only have %AsyncGeneratorFunction.prototype%, not %AsyncGeneratorFunction.prototype.prototype%! // a. Let prototype be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). - // prototype = Object::create(global_object, global_object.async_generator_prototype()); + prototype = Object::create(global_object, global_object.async_generator_function_prototype_prototype()); // b. Perform ! DefinePropertyOrThrow(F, "prototype", PropertyDescriptor { [[Value]]: prototype, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false }). - // function->define_direct_property(vm.names.prototype, prototype, Attribute::Writable); + function->define_direct_property(vm.names.prototype, prototype, Attribute::Writable); } // 35. Else if kind is normal, perform MakeConstructor(F). else if (kind == FunctionKind::Normal) {