mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:47:46 +00:00
LibJS: Set "prototype" property of async generator functions
This commit is contained in:
parent
09e263dd9c
commit
53619176f5
2 changed files with 3 additions and 5 deletions
|
@ -20,7 +20,6 @@
|
||||||
#include <LibJS/Runtime/ExecutionContext.h>
|
#include <LibJS/Runtime/ExecutionContext.h>
|
||||||
#include <LibJS/Runtime/FunctionEnvironment.h>
|
#include <LibJS/Runtime/FunctionEnvironment.h>
|
||||||
#include <LibJS/Runtime/GeneratorObject.h>
|
#include <LibJS/Runtime/GeneratorObject.h>
|
||||||
#include <LibJS/Runtime/GeneratorPrototype.h>
|
|
||||||
#include <LibJS/Runtime/GlobalObject.h>
|
#include <LibJS/Runtime/GlobalObject.h>
|
||||||
#include <LibJS/Runtime/NativeFunction.h>
|
#include <LibJS/Runtime/NativeFunction.h>
|
||||||
#include <LibJS/Runtime/PromiseConstructor.h>
|
#include <LibJS/Runtime/PromiseConstructor.h>
|
||||||
|
@ -125,7 +124,7 @@ void ECMAScriptFunctionObject::initialize(GlobalObject& global_object)
|
||||||
case FunctionKind::Async:
|
case FunctionKind::Async:
|
||||||
break;
|
break;
|
||||||
case FunctionKind::AsyncGenerator:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
// 27.7.4 AsyncFunction Instances, https://tc39.es/ecma262/#sec-async-function-instances
|
// 27.7.4 AsyncFunction Instances, https://tc39.es/ecma262/#sec-async-function-instances
|
||||||
|
|
|
@ -250,12 +250,11 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> FunctionConstructor::create_dynamic
|
||||||
}
|
}
|
||||||
// 34. Else if kind is asyncGenerator, then
|
// 34. Else if kind is asyncGenerator, then
|
||||||
else if (kind == FunctionKind::AsyncGenerator) {
|
else if (kind == FunctionKind::AsyncGenerator) {
|
||||||
// FIXME: We only have %AsyncGeneratorFunction.prototype%, not %AsyncGeneratorFunction.prototype.prototype%!
|
|
||||||
// a. Let prototype be OrdinaryObjectCreate(%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 }).
|
// 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).
|
// 35. Else if kind is normal, perform MakeConstructor(F).
|
||||||
else if (kind == FunctionKind::Normal) {
|
else if (kind == FunctionKind::Normal) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue