mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-24 03:59:09 +00:00
LibJS: Add interpreter exception checks
This commit is contained in:
committed by
Andreas Kling
parent
f306ddb78b
commit
4e33fbdb67
@@ -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