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:
Andreas Kling 2020-04-04 23:45:13 +02:00
commit 2db8716a6f
Notes: sideshowbarker 2024-07-19 07:55:29 +09:00
3 changed files with 17 additions and 7 deletions

View file

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