Summary
new Blob(x) where x is an instance of a subclass of Array (e.g. class MyArray extends Array {}) does not iterate the elements — it treats the instance as a single non-array part and stringifies its constructor. A plain array of the same values works. Wrong result, no error.
Repro
class MyArray extends Array {}
const arr = MyArray.from(["hello", " ", "derived"]);
const blob = new Blob(arr as any);
console.log(blob.size, await blob.text());
// perry: 36 "function MyArray() { [native code] }"
// expected: 13 "hello derived"
Likely cause
The BlobPart-array detection appears to check for the exact Array and misses Array subclasses. It should use the iterable/Symbol.iterator path (the constructor takes any iterable of parts).
Related: #2959 (Blob/File constructor input coercion).
Environment
perry release binary dated 2026-07-05, PERRY_NO_AUTO_OPTIMIZE=1, with libperry_stdlib.a. Found via secret-tests/bun-suite; from Bun's web/fetch/blob-array-fast-path.test.ts ("DerivedArray").
Summary
new Blob(x)wherexis an instance of a subclass ofArray(e.g.class MyArray extends Array {}) does not iterate the elements — it treats the instance as a single non-array part and stringifies its constructor. A plain array of the same values works. Wrong result, no error.Repro
Likely cause
The
BlobPart-array detection appears to check for the exactArrayand missesArraysubclasses. It should use the iterable/Symbol.iteratorpath (the constructor takes any iterable of parts).Related: #2959 (Blob/File constructor input coercion).
Environment
perry release binary dated 2026-07-05,
PERRY_NO_AUTO_OPTIMIZE=1, withlibperry_stdlib.a. Found via secret-tests/bun-suite; from Bun'sweb/fetch/blob-array-fast-path.test.ts("DerivedArray").