mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
LibJS: Bring function environment records closer to the spec
This patch adds FunctionEnvironmentRecord as a subclass of the existing DeclarativeEnvironmentRecord. Things that are specific to function environment records move into there, simplifying the base. Most of the abstract operations related to function environment records are rewritten to match the spec exactly. I also had to implement GetThisEnvironment() and GetSuperConstructor() to keep tests working after the changes, so that's nice as well. :^)
This commit is contained in:
parent
6ed6434bab
commit
aabd82d508
28 changed files with 228 additions and 159 deletions
|
@ -35,11 +35,13 @@ public:
|
|||
|
||||
auto& bytecode_executable() const { return m_bytecode_executable; }
|
||||
|
||||
virtual EnvironmentRecord* environment() override { return m_parent_scope; }
|
||||
|
||||
protected:
|
||||
virtual bool is_strict_mode() const final { return m_is_strict; }
|
||||
|
||||
private:
|
||||
virtual DeclarativeEnvironmentRecord* create_environment_record() override;
|
||||
virtual FunctionEnvironmentRecord* create_environment_record() override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
Value execute_function_body();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue