mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibJS: Add interpreter exception checks
This commit is contained in:
parent
f306ddb78b
commit
4e33fbdb67
11 changed files with 137 additions and 36 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue