Files
sousa-gecko/testing/web-platform/tests/FileAPI/blob/Blob-newobject.any.js
T
Suyeon Ji 4a127d3c5f Bug 1987976 [wpt PR 54797] - Use NewObject for Blob methods that return new instances, a=testonly
Automatic update from web-platform-tests
Use NewObject for Blob methods that return new instances

This change updates the IDL to match the W3C spec by explicitly marking
methods that always return a new object with NewObject.

This CL has no behavior changes.

Bug: 436420911
Change-Id: I42d3c048f3dd1edae2ae4fd4f791fd127d807d8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6824263
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Jinho Bang <zino@chromium.org>
Commit-Queue: Jinho Bang <zino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1513751}

--

wpt-commits: 19bf7a9a783173bfb3c8a30e1ee826314a0302da
wpt-pr: 54797
2025-09-11 12:46:40 +00:00

13 lines
405 B
JavaScript

// META: title=Blob methods return new objects ([NewObject])
// META: global=window,worker
'use strict';
['stream', 'text', 'arrayBuffer', 'bytes'].forEach(method => {
test(() => {
const blob = new Blob(['PASS']);
const a = blob[method]();
const b = blob[method]();
assert_not_equals(a, b, `Blob.${method}() must return a new object`);
}, `Blob.${method}() returns [NewObject]`);
});