diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Function.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Function.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Function.h b/Userland/Libraries/LibJS/Runtime/Function.h index f8298515bb..997e5e2bde 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.h +++ b/Userland/Libraries/LibJS/Runtime/Function.h @@ -47,6 +47,16 @@ public: // Used as the outer environment when evaluating the code of the function. virtual EnvironmentRecord* environment() { return nullptr; } + enum class ThisMode : u8 { + Lexical, + Strict, + Global, + }; + + // [[ThisMode]] + ThisMode this_mode() const { return m_this_mode; } + void set_this_mode(ThisMode this_mode) { m_this_mode = this_mode; } + protected: virtual void visit_edges(Visitor&) override; @@ -59,6 +69,7 @@ private: Vector<Value> m_bound_arguments; Value m_home_object; ConstructorKind m_constructor_kind = ConstructorKind::Base; + ThisMode m_this_mode { ThisMode::Global }; }; } |