mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:57:34 +00:00
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:
parent
d98fbd192e
commit
ddd69e3660
8 changed files with 138 additions and 130 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/ScriptFunction.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue