1
Fork 0
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:
howar6hill 2020-03-12 19:22:13 +08:00 committed by GitHub
parent 425fd3ce51
commit 01133733dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 14 deletions

View file

@ -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;