Repository navigation
Conversation
|
Status: this PR now adds tests only. The change itself is oven-sh/WebKit#324, and main has it. Reproduced with bun 1.3.14, which is older than the change. |
|
Updated 6:35 PM PT - Oct 16th, 2026
✅ @robobun, your commit 526fa68a26bbbe76a14bc1fe73ae4969d2dc2694 passed in 🧪 To try this PR locally: bunx bun-pr 35290That installs a local version of the PR into your bun-35290 --bun |
oven-sh/WebKit#324 made Date.parse and new Date(string) take NBSP, BOM and each Zs code point as a separator, as V8 does. bun has it since the WebKit pin of 21b593c. No test covered it. Add five tests to test/js/node/v8/v8-date-parser.test.js. Each expected value is what Node.js v26.3.0 returns.
33c4224 to
526fa68
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…9189) ### Problem - 13 open test-only PRs add or tighten regression tests for JavaScriptCore behavior (JIT tiers, garbage collection, Yarr, `Date.parse`, stack traces). Each one waits for its own review and its own CI run. - None of them changes `src/`. The tests already pass on main. ### Fix - This PR folds 13 open test-only PRs into one branch. Each commit is one PR, applied on main (`d3d074e32`) with no other change. Notes lists them. - Verified: the 15 touched test files pass on main with the release build on Linux x64 (527 tests pass, 0 fail). 14 of them also pass with the debug ASAN build (536 pass, 0 fail). `gc-controller-cadence.test.ts` builds standalone executables, so I ran it with the release build only. - One more commit answers review: the large-environment stack tests now skip when the soft stack limit is under 8 MB (`36cc5602dd`). Before, they failed there with `E2BIG`. - The original PRs are closed in favor of this one. ### Background - Most of these tests pin fixes that reached main through WebKit upgrades: no tail calls in generator and async bodies, the Yarr surrogate mask, typed array accounting in the collector, a DFG `!` fold. - The other tests cover `Error.stackTraceLimit`, `util.getCallSites`, `Uint8Array.prototype.setFromBase64`, non-ASCII white space in `Date.parse`, and an import cycle that writes a module variable early. - Each commit stands alone. To drop one test from this PR, revert its commit. <details><summary>Notes</summary> | PR | Commit | Title | |---|---|---| | #35290 | `4202a47ab` | test: cover non-ASCII white space in Date.parse | | #39453 | `64ffe6869` | Test Uint8Array.prototype.setFromBase64 into a zero-length target | | #40231 | `d4c592fb6` | Add regression tests for the Yarr JIT surrogate mask | | #42321 | `d1b832532` | test: module variables written through an import cycle before the module runs (oven-sh/WebKit#624) | | #42335 | `7cc721499` | Add tests for the WebKit cf1b36ec8703 upgrade: no tail calls in generator and async bodies | | #42501 | `2d63ff35b` | test: cover Error.stackTraceLimit stores from hot sites and util.getCallSites frame counts | | #42658 | `8b224c511` | Add a regression test for oven-sh/WebKit#649: a collection inside a host function hook freed the JIT code of the caller | | #42880 | `eb5365ba1` | test: import of a module whose code generation fails keeps its exception checked | | #42979 | `3f2401021` | Add tests for oven-sh/WebKit#684: a typed array vector counts as allocated once, and dead ArrayBuffers do not force full collections | | #44302 | `3c3223b7d` | Test that recursion checks hold with a large environment on Linux | | #45220 | `46c4fcb46` | Test `!` of Int32 arithmetic under a bitwise operator in DFG code (WebKit 96115d8717) | | #46873 | `921106ac1` | test: run the domjit.test.ts loops in a child process and assert the FTL tier | | #47137 | `eb854ed20` | test: cover the two Yarr fixes that came with WebKit 23d7f1dcef62 | </details>
Behaviour change: none
Problem
Date.parsewith non-ASCII white space.Date.parse("Jul\u00a023\u00a02026\u00a010:00:00\u00a0GMT+0000")returnedNaNwhere Node returns1784800800000.Fix
test/js/node/v8/v8-date-parser.test.js, the existing file for this parser.bun bd test test/js/node/v8/v8-date-parser.test.jspasses 10 of 10 on main (f8bc171). bun 1.3.14 is older than the change and fails three of the new tests.Background
Date.parseandnew Date(string)use a port of V8's date parser,JSDateMath-v8.cppin the WebKit fork. The port reads UTF-8 bytes and knows ASCII white space only.DateCache::parseDatereplaces each non-ASCII ECMAScript WhiteSpace code point with a space before the parse. Only the fork has that step, so a WebKit upgrade can lose it.test/js/bun/jsc/date-parse.test.ts. The parser already has a test file, so the rows are there now.Notes
Where the change is on main
81ea8578e5. bun commit 21b593c (Remove $vm from release builds #35359) movedWEBKIT_VERSIONto5491700992, one commit after it. bun v1.4.0 is the first release with it.87ee10da087b. The merge commit is an ancestor of it, andJSDateMath.cppat that pin has the replacement inDateCache::parseDate.What each test does
NaN, U+202F already worked7/23/2026, 10:00:00\u00a0AM,2026-07-23\u00a0,2026-07-23\u3000)"\ufeff2026-07-23T10:00:00Z"staysNaN, as in Node.new Date(2026, 6, 23, 10), so it does not depend on the time zone of the machine.Not covered: U+000B after a time
DateCache::parseDatedoes not replace it in an 8-bit string, andisASCIIWhitespacein the scanner has no VT.Date.parse("Jul 23 2026 10:00:00\vGMT+0000")isNaNon main and1784800800000in Node. The same date in a 16-bit string parses. VT in other places parses.Earlier state of this PR
WEBKIT_VERSIONtoautobuild-preview-pr-324-c0a3ca4dand added 141 tests in a new file. The preview release is gone and main has moved the pin many times since.