LibJS: Make the AST reference-counted

This allows function objects to outlive the original parsed program
without their ScopeNode disappearing.
This commit is contained in:
Andreas Kling 2020-03-18 11:23:53 +01:00
commit ddd69e3660
Notes: sideshowbarker 2024-07-19 08:15:48 +09:00
8 changed files with 138 additions and 130 deletions

View file

@ -44,7 +44,7 @@ private:
virtual bool is_script_function() const final { return true; }
virtual const char* class_name() const override { return "ScriptFunction"; }
const ScopeNode& m_body;
NonnullRefPtr<ScopeNode> m_body;
const Vector<String> m_parameters;
};