Commit 2ae0560
committed
Fix parsing dates with more than 9 contiguous digits
Most engines like v8, and current versions of spidermonkey versions (128 at
least) return NaN while QuickJS parses up to 9 digits at a time, then tries to
parse the rest. Trying to parse extra digits can sometimes produce random
garbage. To fix it, when parsing the initial integer parse as many digits as we
can (max = 0) instead of just 9.
Add a few tests, including uncommenting some previous ones, and ensure they
pass on v8 version 11.
Fixes: #3841 parent 6e2e68f commit 2ae0560
2 files changed
+32
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50245 | 50245 | | |
50246 | 50246 | | |
50247 | 50247 | | |
50248 | | - | |
| 50248 | + | |
50249 | 50249 | | |
50250 | 50250 | | |
50251 | 50251 | | |
| |||
50256 | 50256 | | |
50257 | 50257 | | |
50258 | 50258 | | |
50259 | | - | |
| 50259 | + | |
50260 | 50260 | | |
50261 | 50261 | | |
50262 | 50262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| 543 | + | |
543 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
544 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
545 | 573 | | |
546 | 574 | | |
547 | | - | |
548 | | - | |
| 575 | + | |
| 576 | + | |
549 | 577 | | |
550 | 578 | | |
551 | 579 | | |
| |||
0 commit comments