Skip to content

buffer: use Clamp conversion in Blob slice#64739

Open
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:fix-blob-slice-clamp
Open

buffer: use Clamp conversion in Blob slice#64739
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:fix-blob-slice-clamp

Conversation

@HoonDongKang

@HoonDongKang HoonDongKang commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This aligns Blob.prototype.slice() with the File API Web IDL definition:

Blob slice(optional [Clamp] long long start,
           optional [Clamp] long long end,
           optional DOMString contentType);

The start and end arguments should use Web IDL [Clamp] conversion.

This fixes the expected failures in Blob-slice.any.js for fractional start/end values.

Refs: https://www.w3.org/TR/FileAPI/#dfn-Blob

Testing

$ ./node test/wpt/test-blob.js Blob-slice.any.js

Files: 1/1 ran, 1 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes
Subtests: 150 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes
$ tools/test.py wpt/test-blob

[00:00|% 100|+   1|-   0]: Done

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/web-standards

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jul 25, 2026
Align Blob.prototype.slice() with the File API Web IDL definition by
using [Clamp] conversion for the start and end arguments.

This fixes the Blob-slice.any.js WPT expected failures for fractional
start and end values.

Refs: https://www.w3.org/TR/FileAPI/#dfn-Blob
Signed-off-by: HoonDongKang <d159123@naver.com>
@HoonDongKang
HoonDongKang force-pushed the fix-blob-slice-clamp branch from e284bd7 to 6c536b1 Compare July 25, 2026 15:07
@HoonDongKang HoonDongKang changed the title blob: use Clamp conversion in Blob slice buffer: use Clamp conversion in Blob slice Jul 25, 2026
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (0618e9f) to head (6c536b1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64739      +/-   ##
==========================================
- Coverage   90.14%   90.13%   -0.01%     
==========================================
  Files         743      743              
  Lines      242408   242407       -1     
  Branches    45656    45644      -12     
==========================================
- Hits       218520   218496      -24     
- Misses      15387    15401      +14     
- Partials     8501     8510       +9     
Files with missing lines Coverage Δ
lib/internal/blob.js 89.86% <100.00%> (ø)

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@panva panva added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 25, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants