mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 11:36:22 +00:00
LibJS: Trim whitespace from string before coercing to number
This commit is contained in:
parent
f39c7c2978
commit
de42ddfd93
Notes:
sideshowbarker
2024-07-19 06:41:03 +09:00
Author: https://github.com/linusg
Commit: de42ddfd93
Pull-request: https://github.com/SerenityOS/serenity/pull/2208
2 changed files with 4 additions and 2 deletions
|
@ -35,6 +35,9 @@ try {
|
|||
assert(-"Infinity" === -Infinity);
|
||||
assert(-"+Infinity" === -Infinity);
|
||||
assert(-"-Infinity" === Infinity);
|
||||
assert(+" \r \t \n " === 0);
|
||||
assert(+" \n \t Infinity \r " === Infinity);
|
||||
assert(+"\r \n1.23 \t\t\t \n" === 1.23);
|
||||
|
||||
assert(isNaN(+undefined));
|
||||
assert(isNaN(-undefined));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue