mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibJS: Add interpreter exception checks
This commit is contained in:
committed by
Andreas Kling
parent
f306ddb78b
commit
4e33fbdb67
Notes:
sideshowbarker
2024-07-19 05:45:16 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/4e33fbdb673 Pull-request: https://github.com/SerenityOS/serenity/pull/2522
@@ -79,6 +79,8 @@ Value StringConstructor::raw(Interpreter& interpreter)
|
||||
return {};
|
||||
|
||||
auto raw = template_object->get("raw");
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
if (raw.is_empty() || raw.is_undefined() || raw.is_null()) {
|
||||
interpreter.throw_exception<TypeError>(String::format("Cannot convert property 'raw' to object from %s", raw.is_null() ? "null" : "undefined"));
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user