Repository navigation
Fix Blob.slice end handling when start is omitted - #59533
Merged
vzaidman merged 1 commit intoOct 28, 2026
Merged
Conversation
vzaidman
self-requested a review
October 27, 2026 18:04
vzaidman
approved these changes
Oct 27, 2026
Visual regression2 visual difference(s) at ios
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Summary:
new Blob(['abcdef']).slice(undefined, 3)currently returns all six bytes instead of the first three. End normalization is inside the numeric-start branch, so an omitted start causes the end argument to be ignored. This also affects zero/negative ends and slices of existing views.Default
startto zero so these calls follow the existing range calculation. Numeric-start behavior and the optional public parameter remain unchanged. This matches the File API slicing algorithm.Changelog:
[GENERAL] [FIXED] - Respect the end offset in Blob.slice when the start argument is undefined.
Test Plan:
866034f; all pass with the fix.yarn test packages/react-native/Libraries/Blob packages/react-native/Libraries/Network packages/react-native/Libraries/WebSocket --runInBand --watchman=false: 55 tests pass across five suites on Windows, Node 24.15.0.--max-warnings 0) pass on both changed files;git diff --checkpasses.yarn build-typestranslates the package declarations successfully, with byte-identical generated Blob declarations before/after the fix. Its later API snapshot step fails on a Windows path embedded in an ActionSheetIOS identifier; the same failure reproduces with unchanged Blob source. No generated files changed.