mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibJS: Move the current exception from Interpreter to VM
This will allow us to throw exceptions even when there is no active interpreter in the VM.
This commit is contained in:
parent
675b482fe7
commit
4a8bfcdd1c
12 changed files with 26 additions and 23 deletions
|
@ -73,7 +73,7 @@ Sheet::Sheet(Workbook& workbook)
|
|||
dbg() << "Spreadsheet: Failed to run runtime code: ";
|
||||
for (auto& t : exc->trace())
|
||||
dbg() << t;
|
||||
interpreter().clear_exception();
|
||||
interpreter().vm().clear_exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ JS::Value Sheet::evaluate(const StringView& source, Cell* on_behalf_of)
|
|||
interpreter().run(global_object(), program);
|
||||
if (interpreter().exception()) {
|
||||
auto exc = interpreter().exception()->value();
|
||||
interpreter().clear_exception();
|
||||
interpreter().vm().clear_exception();
|
||||
return exc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue