mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Add a [[Realm]] getter to FunctionObject and use it where needed
Defined by https://tc39.es/ecma262/#sec-ordinaryfunctioncreate step #17 and by https://tc39.es/ecma262/#sec-createbuiltinfunction step #6.
This commit is contained in:
parent
38b8fa8f3e
commit
5606332ed7
Notes:
sideshowbarker
2024-07-18 11:11:49 +09:00
Author: https://github.com/IdanHo
Commit: 5606332ed7
Pull-request: https://github.com/SerenityOS/serenity/pull/8338
5 changed files with 11 additions and 3 deletions
|
@ -110,9 +110,8 @@ GlobalObject* get_function_realm(GlobalObject& global_object, FunctionObject con
|
|||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
// FIXME: not sure how to do this currently.
|
||||
// 2. If obj has a [[Realm]] internal slot, then
|
||||
// a. Return obj.[[Realm]].
|
||||
if (function.realm())
|
||||
return function.realm();
|
||||
if (is<BoundFunction>(function)) {
|
||||
auto& bound_function = static_cast<BoundFunction const&>(function);
|
||||
auto& target = bound_function.target_function();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue