1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

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.
This commit is contained in:
Linus Groh 2021-09-11 21:42:01 +01:00
parent 332946ab4f
commit 06e89311fa
8 changed files with 31 additions and 11 deletions

View file

@ -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,