mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
LibJS: Add the Function.[[ThisMode]] field
This is not a behavioral change in itself, just prep work for future spec-compliance changes.
This commit is contained in:
parent
b650d11dd3
commit
667bba2410
2 changed files with 18 additions and 0 deletions
|
@ -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 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue