1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 09:37:34 +00:00

LibJS: Add getters for %{Async,}GeneratorFunction.prototype.prototype%

These exist as {Async,}GeneratorPrototype of course, but the spec
doesn't always refer to them by the direct name.
This commit is contained in:
Linus Groh 2022-05-05 08:49:46 +02:00
parent 0c65624a32
commit dd547c3374
2 changed files with 6 additions and 1 deletions

View file

@ -243,7 +243,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> FunctionConstructor::create_dynamic
// 33. If kind is generator, then
if (kind == FunctionKind::Generator) {
// a. Let prototype be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%).
prototype = Object::create(global_object, global_object.generator_prototype());
prototype = Object::create(global_object, global_object.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);