mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibJS: Assert when exception is not cleared before Interpreter::run()
This is to prevent bugs like #3091 (fixed in 9810f8872c21eaf2aefff25347d957cd26f34c2d) in the future; we generally don't want Interpreter::run() to be called if the interpreter still has an exception stored. Sure, it could clear those itself but letting users of the interpreter do it explicitly seems sensible.
This commit is contained in:
parent
1d728af5c4
commit
36c738d9bf
Notes:
sideshowbarker
2024-07-19 03:53:03 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/36c738d9bf5 Pull-request: https://github.com/SerenityOS/serenity/pull/3092 Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 0 deletions
|
@ -60,6 +60,8 @@ Interpreter::~Interpreter()
|
|||
|
||||
Value Interpreter::run(GlobalObject& global_object, const Statement& statement, ArgumentVector arguments, ScopeType scope_type)
|
||||
{
|
||||
ASSERT(!exception());
|
||||
|
||||
if (statement.is_program()) {
|
||||
if (m_call_stack.is_empty()) {
|
||||
CallFrame global_call_frame;
|
||||
|
|
Loading…
Add table
Reference in a new issue