mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibJS: Don't return the "last computed value" from Interpreter::run()
Only return whatever a "return" statment told us to return. The last computed value is now available in Interpreter::last_value() instead, where the REPL can pick it up.
This commit is contained in:
parent
97cd1173fa
commit
2db8716a6f
3 changed files with 17 additions and 7 deletions
|
@ -154,11 +154,15 @@ public:
|
|||
return throw_exception(heap().allocate<Exception>(value));
|
||||
}
|
||||
|
||||
Value last_value() const { return m_last_value; }
|
||||
|
||||
private:
|
||||
Interpreter();
|
||||
|
||||
Heap m_heap;
|
||||
|
||||
Value m_last_value;
|
||||
|
||||
Vector<ScopeFrame> m_scope_stack;
|
||||
Vector<CallFrame> m_call_stack;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue