Commit e6cebad
authored
Fix date parsing in case there is more than nine initial digits
Backport from upstream:
bellard/quickjs@030333c
Most engines like v8, and current versions of spidermonkey versions (v128 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 (upstream didn't include the extra tests).1 parent 97e6ef9 commit e6cebad
2 files changed
+23
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50723 | 50723 | | |
50724 | 50724 | | |
50725 | 50725 | | |
| 50726 | + | |
| 50727 | + | |
| 50728 | + | |
50726 | 50729 | | |
50727 | 50730 | | |
50728 | 50731 | | |
| |||
50766 | 50769 | | |
50767 | 50770 | | |
50768 | 50771 | | |
50769 | | - | |
| 50772 | + | |
50770 | 50773 | | |
50771 | 50774 | | |
50772 | 50775 | | |
| |||
50960 | 50963 | | |
50961 | 50964 | | |
50962 | 50965 | | |
50963 | | - | |
| 50966 | + | |
50964 | 50967 | | |
50965 | 50968 | | |
50966 | 50969 | | |
| |||
50971 | 50974 | | |
50972 | 50975 | | |
50973 | 50976 | | |
50974 | | - | |
| 50977 | + | |
50975 | 50978 | | |
50976 | 50979 | | |
50977 | 50980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
611 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
612 | 627 | | |
613 | 628 | | |
614 | | - | |
615 | | - | |
| 629 | + | |
| 630 | + | |
616 | 631 | | |
617 | 632 | | |
618 | 633 | | |
| |||
0 commit comments