mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:48:14 +00:00
LibJS: Add Value::is_nullish()
This commit is contained in:
parent
ef1b21004f
commit
fa18baf3e8
9 changed files with 22 additions and 21 deletions
|
@ -87,7 +87,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw)
|
|||
auto raw = template_object->get("raw");
|
||||
if (vm.exception())
|
||||
return {};
|
||||
if (raw.is_empty() || raw.is_undefined() || raw.is_null()) {
|
||||
if (raw.is_empty() || raw.is_nullish()) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::StringRawCannotConvert, raw.is_null() ? "null" : "undefined");
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue