mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
LibJS: Return empty value on exception in Date.parse(), not NaN
This is discarded anyway, so let's not confuse ourselves by returning a NaN number value that's not going to be used.
This commit is contained in:
parent
db340ae7aa
commit
2ed7f75e95
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateConstructor::parse)
|
||||||
|
|
||||||
auto iso_8601 = vm.argument(0).to_string(global_object);
|
auto iso_8601 = vm.argument(0).to_string(global_object);
|
||||||
if (vm.exception())
|
if (vm.exception())
|
||||||
return js_nan();
|
return {};
|
||||||
|
|
||||||
return parse_simplified_iso8601(iso_8601);
|
return parse_simplified_iso8601(iso_8601);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue