mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Do not create a prototype property on AsyncFunction instances
This commit is contained in:
parent
08d1ae58b1
commit
29dd9d75ef
Notes:
sideshowbarker
2024-07-17 18:31:42 +09:00
Author: https://github.com/IdanHo
Commit: 29dd9d75ef
Pull-request: https://github.com/SerenityOS/serenity/pull/12656
Reviewed-by: https://github.com/linusg ✅
1 changed files with 4 additions and 1 deletions
|
@ -127,7 +127,10 @@ void ECMAScriptFunctionObject::initialize(GlobalObject& global_object)
|
|||
// FIXME: Add the AsyncGeneratorObject and set it as prototype.
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue