1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibJS: Do not create a prototype property on AsyncFunction instances

This commit is contained in:
Idan Horowitz 2022-02-19 17:56:46 +02:00 committed by Linus Groh
parent 08d1ae58b1
commit 29dd9d75ef

View file

@ -127,7 +127,10 @@ void ECMAScriptFunctionObject::initialize(GlobalObject& global_object)
// FIXME: Add the AsyncGeneratorObject and set it as prototype. // FIXME: Add the AsyncGeneratorObject and set it as prototype.
break; break;
} }
define_direct_property(vm.names.prototype, prototype, Attribute::Writable); // 27.7.4 AsyncFunction Instances, https://tc39.es/ecma262/#sec-async-function-instances
// AsyncFunction instances do not have a prototype property as they are not constructible.
if (m_kind != FunctionKind::Async)
define_direct_property(vm.names.prototype, prototype, Attribute::Writable);
} }
} }