Commit Graph
13 Commits
Author SHA1 Message Date
Donghoon Kang a0dd71e6b7 buffer: use Clamp conversion in Blob slice
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>
PR-URL: https://github.com/nodejs/node/pull/64739
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-07-29 00:54:37 +00:00
Ms2ger df5a92517b lib: fix sequence argument handling in Blob constructor
This uses the existing WebIDL infrastructure to handle the iteration
over the argument correctly according to the specification.

Note that we can't avoid looping over the input twice: we only know the
value of the 'endings' option after converting the blob parts into an
array.

PR-URL: https://github.com/nodejs/node/pull/62179
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-04-18 14:27:45 +00:00
James M Snell db887ea6c1 test: disable flaky WPT Blob test on AIX
The test Blob-array-buffer.any.js can be flaky on
AIX due to a recognized race condition in v8.

The failed assert is in deps/v8/src/base/platform/platform-aix.cc
on line 199, preceeded by the comment:

> If this check fails it's most likely due to a racing condition
> where another thread has mapped the same address right before we
> do. Since this could cause hard-to-debug issues, potentially with
> security impact, and we can't recover from this, the best we can do
> is abort the process.

Disabling the test on AIX until the underlying issue can
be resolved (if it can be resolved at all) is really the
only option currently.

Reliability Report: https://github.com/nodejs/reliability/blob/main/reports/2026-03-28.md
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus 4.6
PR-URL: https://github.com/nodejs/node/pull/62470
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-03-30 04:52:23 +00:00
Ms2ger 7cf2dad715 lib: improve argument handling in Blob constructor
As specified in WebIDL (<https://webidl.spec.whatwg.org/#js-dictionary>),
the fields of a dictionary need to be read in lexicographical order.

PR-URL: https://github.com/nodejs/node/pull/61980
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-02-27 10:25:22 +00:00
Ms2ger 3d30c302c3 test: update FileAPI tests from WPT
PR-URL: https://github.com/nodejs/node/pull/61750
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-02-13 15:51:31 +00:00
Debadree Chatterjee 23a3410f9f lib: allow byob reader for 'blob.stream()'
Fixes: https://github.com/nodejs/node/issues/47993
PR-URL: https://github.com/nodejs/node/pull/49713
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-09-22 06:16:46 +00:00
Filip Skokan 68e83901f3 test: update WPT resources, common, streams, FileAPI, broadcastchannel
PR-URL: https://github.com/nodejs/node/pull/46912
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2023-03-07 10:19:23 +01:00
Khafra 916af4ef2d buffer: introduce File
PR-URL: https://github.com/nodejs/node/pull/45139
Fixes: https://github.com/nodejs/node/issues/39015
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-11-10 20:52:45 +00:00
Filip Skokan c3ff198a77 test: update WPT runner
PR-URL: https://github.com/nodejs/node/pull/43455
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2022-08-10 12:39:20 +00:00
James M Snell 793c08b8d1 test: enable blob.prototype.stream tests
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39693
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2021-08-12 07:23:12 -07:00
Michaël Zasso bba5aacc11 test: terminate WPT workers after test completion
PR-URL: https://github.com/nodejs/node/pull/37627
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-03-08 21:56:03 +01:00
Michaël Zasso 6b289853b2 buffer: make Blob's slice method more spec-compliant
PR-URL: https://github.com/nodejs/node/pull/37361
Fixes: https://github.com/nodejs/node/issues/37335
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-17 14:07:57 +01:00
Michaël Zasso 7be72850d3 test: add wpt tests for Blob
PR-URL: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-18 13:55:27 -08:00