LibJS: Track source positions all the way down to exceptions

This makes exceptions have a trace of source positions too, which could
probably be helpful in making fancier error tracebacks.
This commit is contained in:
AnotherTest 2020-12-28 20:45:22 +03:30 committed by Andreas Kling
commit b34b681811
Notes: sideshowbarker 2024-07-19 00:28:37 +09:00
10 changed files with 647 additions and 245 deletions

View file

@ -143,6 +143,16 @@ void Interpreter::exit_scope(const ScopeNode& scope_node)
vm().unwind(ScopeType::None);
}
void Interpreter::enter_node(const ASTNode& node)
{
vm().push_ast_node(node);
}
void Interpreter::exit_node(const ASTNode&)
{
vm().pop_ast_node();
}
void Interpreter::push_scope(ScopeFrame frame)
{
m_scope_stack.append(move(frame));