1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +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:
Idan Horowitz 2021-06-30 17:54:47 +03:00 committed by Linus Groh
parent 38b8fa8f3e
commit 5606332ed7
5 changed files with 11 additions and 3 deletions

View file

@ -37,6 +37,8 @@ public:
virtual EnvironmentRecord* environment() override { return m_environment; }
GlobalObject* realm() const override { return m_realm; }
protected:
virtual bool is_strict_mode() const final { return m_is_strict; }
@ -55,6 +57,7 @@ private:
const Vector<FunctionNode::Parameter> m_parameters;
Optional<Bytecode::Executable> m_bytecode_executable;
EnvironmentRecord* m_environment { nullptr };
GlobalObject* m_realm { nullptr };
i32 m_function_length { 0 };
FunctionKind m_kind { FunctionKind::Regular };
bool m_is_strict { false };