mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibJS: Early return from Date string parsing on empty string
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Loading Ladybird on Github results in 37 debug logs about being unable to parse an empty Date string. This log is intended to catch Date formats we do not support to detect web compatability problems, which makes this case not particuarly useful to log. Instead of trying to parse all of the different date formats and logging that the string is not valid, let's just return NAN immediately.
This commit is contained in:
parent
f41cbfa2a9
commit
ee35e93eb2
Notes:
github-actions[bot]
2024-10-13 08:13:46 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/ee35e93eb23 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1756
1 changed files with 3 additions and 0 deletions
|
@ -152,6 +152,9 @@ static double parse_simplified_iso8601(ByteString const& iso_8601)
|
|||
|
||||
static double parse_date_string(VM& vm, ByteString const& date_string)
|
||||
{
|
||||
if (date_string.is_empty())
|
||||
return NAN;
|
||||
|
||||
auto value = parse_simplified_iso8601(date_string);
|
||||
if (isfinite(value))
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue