mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
Fixes #22003 The scalar fallback path in IndexOfNeedsEscapeForJavaScriptStringImpl had `(char_ < 0x20 && char_ != 0x09)` which incorrectly exempted tab characters (0x09) from escaping. This created an inconsistency with the SIMD path which correctly detects tabs as needing escape (since tab < 0x20). While tabs would typically be caught by the SIMD path in most cases, this inconsistency could cause issues when tabs appear in the small remainder portion after SIMD processing, leading to invalid JSON in sourcemaps. The fix removes the `&& char_ != 0x09` exemption, ensuring tabs are always properly detected as needing escape in both SIMD and scalar code paths.