mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibJS: Allow functions to take arguments (#1405)
This commit is contained in:
parent
425fd3ce51
commit
01133733dd
7 changed files with 46 additions and 14 deletions
|
@ -49,7 +49,7 @@ public:
|
|||
Interpreter();
|
||||
~Interpreter();
|
||||
|
||||
Value run(const ScopeNode&, ScopeType = ScopeType::Block);
|
||||
Value run(const ScopeNode&, HashMap<String, Value> scope_variables = {}, ScopeType = ScopeType::Block);
|
||||
|
||||
Object& global_object() { return *m_global_object; }
|
||||
const Object& global_object() const { return *m_global_object; }
|
||||
|
@ -65,7 +65,7 @@ public:
|
|||
void collect_roots(Badge<Heap>, HashTable<Cell*>&);
|
||||
|
||||
private:
|
||||
void enter_scope(const ScopeNode&, ScopeType);
|
||||
void enter_scope(const ScopeNode&, HashMap<String, Value> scope_variables, ScopeType);
|
||||
void exit_scope(const ScopeNode&);
|
||||
|
||||
Heap m_heap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue