1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:07: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

@ -36,8 +36,7 @@ public:
auto& bytecode_executable() const { return m_bytecode_executable; }
virtual Environment* environment() override { return m_environment; }
GlobalObject* realm() const override { return m_realm; }
virtual Realm* realm() const override { return m_realm; }
protected:
virtual bool is_strict_mode() const final { return m_is_strict; }
@ -54,7 +53,7 @@ private:
const Vector<FunctionNode::Parameter> m_parameters;
Optional<Bytecode::Executable> m_bytecode_executable;
Environment* m_environment { nullptr };
GlobalObject* m_realm { nullptr };
Realm* m_realm { nullptr };
i32 m_function_length { 0 };
FunctionKind m_kind { FunctionKind::Regular };
bool m_is_strict { false };