From 06e89311fa0d09ac0b0a6bf4ea9b75773ac5d2df Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 11 Sep 2021 21:42:01 +0100 Subject: LibJS: Set the callee context's realm in prepare_for_ordinary_call() This includes making FunctionObject::realm() actually return a Realm, instead of a GlobalObject. --- Userland/Libraries/LibJS/Runtime/FunctionObject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland/Libraries/LibJS/Runtime/FunctionObject.h') diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.h b/Userland/Libraries/LibJS/Runtime/FunctionObject.h index 3cfa762166..dce1c3ea99 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.h @@ -11,6 +11,7 @@ namespace JS { +// 10.2 ECMAScript Function Objects, https://tc39.es/ecma262/#sec-ecmascript-function-objects class FunctionObject : public Object { JS_OBJECT(Function, Object); @@ -48,7 +49,7 @@ public: virtual Environment* environment() { return nullptr; } // [[Realm]] - virtual GlobalObject* realm() const { return nullptr; } + virtual Realm* realm() const { return nullptr; } enum class ThisMode : u8 { Lexical, -- cgit v1.2.3