mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibJS: Implement the ParseScript AO (as JS::Script::parse())
This commit is contained in:
parent
35c4a1ebcb
commit
d823d7da54
2 changed files with 17 additions and 7 deletions
|
@ -18,16 +18,16 @@ namespace JS {
|
|||
class Script : public RefCounted<Script> {
|
||||
public:
|
||||
~Script();
|
||||
static NonnullRefPtr<Script> create(GlobalObject&, NonnullRefPtr<ASTNode> parse_node);
|
||||
static NonnullRefPtr<Script> parse(StringView source_text, GlobalObject&);
|
||||
|
||||
GlobalObject& global_object() { return *m_global_object.cell(); }
|
||||
ASTNode const& parse_node() const { return *m_parse_node; }
|
||||
Program const& parse_node() const { return *m_parse_node; }
|
||||
|
||||
private:
|
||||
Script(GlobalObject&, NonnullRefPtr<ASTNode>);
|
||||
Script(GlobalObject&, NonnullRefPtr<Program>);
|
||||
|
||||
Handle<GlobalObject> m_global_object;
|
||||
NonnullRefPtr<ASTNode> m_parse_node;
|
||||
NonnullRefPtr<Program> m_parse_node;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue