···464464compat-table/es6/Map.constructor-invokes-set.js: failed
465465compat-table/es6/Map.constructor-requires-new.js: OK
466466compat-table/es6/Map.iterator-closing.js: failed
467467-compat-table/es6/Map.iterator-prototype-chain.js: TypeError: Cannot read properties of null (reading 'hasOwnProperty')
467467+compat-table/es6/Map.iterator-prototype-chain.js: OK
468468compat-table/es6/Map.js: OK
469469compat-table/es6/Map.prototype-not-instance.js: failed
470470compat-table/es6/Map.prototype.Symbol.iterator.js: OK
···581581compat-table/es6/Set.constructor-invokes-add.js: failed
582582compat-table/es6/Set.constructor-requires-new.js: OK
583583compat-table/es6/Set.iterator-closing.js: failed
584584-compat-table/es6/Set.iterator-prototype-chain.js: TypeError: Cannot read properties of null (reading 'hasOwnProperty')
584584+compat-table/es6/Set.iterator-prototype-chain.js: OK
585585compat-table/es6/Set.js: OK
586586compat-table/es6/Set.prototype-not-instance.js: failed
587587compat-table/es6/Set.prototype.Symbol.iterator.js: OK
···13431343compat-table/es2025/Iterator.instanceof.js: ReferenceError: 'Iterator' is not defined
13441344compat-table/es2025/Iterator.prototype.Symbol.toStringTag.js: ReferenceError: 'Iterator' is not defined
13451345compat-table/es2025/Iterator.prototype.drop.js: TypeError: undefined is not a function
13461346-compat-table/es2025/Iterator.prototype.every.js: OK
13471347-compat-table/es2025/Iterator.prototype.filter.js: OK
13481348-compat-table/es2025/Iterator.prototype.find.js: OK
13491349-compat-table/es2025/Iterator.prototype.flatMap.js: OK
13501350-compat-table/es2025/Iterator.prototype.forEach.js: OK
13511351-compat-table/es2025/Iterator.prototype.map.js: OK
13521352-compat-table/es2025/Iterator.prototype.reduce.js: OK
13531353-compat-table/es2025/Iterator.prototype.some.js: OK
13461346+compat-table/es2025/Iterator.prototype.every.js: TypeError: undefined is not a function
13471347+compat-table/es2025/Iterator.prototype.filter.js: TypeError: undefined is not a function
13481348+compat-table/es2025/Iterator.prototype.find.js: TypeError: undefined is not a function
13491349+compat-table/es2025/Iterator.prototype.flatMap.js: TypeError: undefined is not a function
13501350+compat-table/es2025/Iterator.prototype.forEach.js: TypeError: undefined is not a function
13511351+compat-table/es2025/Iterator.prototype.map.js: TypeError: undefined is not a function
13521352+compat-table/es2025/Iterator.prototype.reduce.js: TypeError: undefined is not a function
13531353+compat-table/es2025/Iterator.prototype.some.js: TypeError: undefined is not a function
13541354compat-table/es2025/Iterator.prototype.take.js: TypeError: undefined is not a function
13551355compat-table/es2025/Iterator.prototype.toArray.js: TypeError: undefined is not a function
13561356compat-table/es2025/Promise.try.js: OK
+113
examples/spec/blob.js
···11+import { test, testThrows, summary } from './helpers.js';
22+33+console.log('Blob constructor\n');
44+55+const empty = new Blob();
66+test('empty Blob size', empty.size, 0);
77+test('empty Blob type', empty.type, '');
88+99+const b1 = new Blob(['hello']);
1010+test('string part size', b1.size, 5);
1111+1212+const b2 = new Blob(['hello', ' world']);
1313+test('two string parts size', b2.size, 11);
1414+1515+const b3 = new Blob(['hello'], { type: 'text/plain' });
1616+test('type set from options', b3.type, 'text/plain');
1717+1818+const b4 = new Blob(['hello'], { type: 'TEXT/PLAIN' });
1919+test('type lowercased', b4.type, 'text/plain');
2020+2121+const b5 = new Blob(['x'], { type: 'te\x01xt' });
2222+test('invalid type byte โ empty string', b5.type, '');
2323+2424+testThrows('requires new', () => Blob(['x']));
2525+2626+console.log('\nBlob from typed parts\n');
2727+2828+const ab = new Uint8Array([1, 2, 3]).buffer;
2929+const b6 = new Blob([ab]);
3030+test('ArrayBuffer part size', b6.size, 3);
3131+3232+const ta = new Uint8Array([4, 5, 6]);
3333+const b7 = new Blob([ta]);
3434+test('Uint8Array part size', b7.size, 3);
3535+3636+const b8 = new Blob([b1, ' there']);
3737+test('Blob part size', b8.size, 11);
3838+3939+console.log('\nBlob.text()\n');
4040+4141+const bt = await new Blob(['hello world']).text();
4242+test('text() content', bt, 'hello world');
4343+4444+const be = await new Blob().text();
4545+test('empty blob text()', be, '');
4646+4747+console.log('\nBlob.arrayBuffer()\n');
4848+4949+const bab = await new Blob([new Uint8Array([10, 20, 30])]).arrayBuffer();
5050+const view = new Uint8Array(bab);
5151+test('arrayBuffer() byte 0', view[0], 10);
5252+test('arrayBuffer() byte 1', view[1], 20);
5353+test('arrayBuffer() byte 2', view[2], 30);
5454+5555+console.log('\nBlob.bytes()\n');
5656+5757+const bytes = await new Blob([new Uint8Array([7, 8, 9])]).bytes();
5858+test('bytes() is Uint8Array', bytes instanceof Uint8Array, true);
5959+test('bytes() byte 0', bytes[0], 7);
6060+test('bytes() byte 2', bytes[2], 9);
6161+6262+console.log('\nBlob.slice()\n');
6363+6464+const src = new Blob(['hello world']);
6565+const s1 = src.slice(0, 5);
6666+test('slice(0,5) size', s1.size, 5);
6767+test('slice content', await s1.text(), 'hello');
6868+6969+const s2 = src.slice(6);
7070+test('slice(6) size', s2.size, 5);
7171+test('slice(6) content', await s2.text(), 'world');
7272+7373+const s3 = src.slice(-5);
7474+test('slice(-5) size', s3.size, 5);
7575+test('slice(-5) content', await s3.text(), 'world');
7676+7777+const s4 = src.slice(0, 5, 'text/plain');
7878+test('slice with type', s4.type, 'text/plain');
7979+8080+const s5 = src.slice(5, 3);
8181+test('slice end < start โ empty', s5.size, 0);
8282+8383+console.log('\nFile constructor\n');
8484+8585+const f1 = new File(['content'], 'test.txt');
8686+test('File name', f1.name, 'test.txt');
8787+test('File size', f1.size, 7);
8888+test('File type default', f1.type, '');
8989+test('File lastModified is number', typeof f1.lastModified, 'number');
9090+test('File lastModified > 0', f1.lastModified > 0, true);
9191+9292+const f2 = new File(['data'], 'file.txt', { type: 'text/plain', lastModified: 1000 });
9393+test('File type from options', f2.type, 'text/plain');
9494+test('File lastModified from options', f2.lastModified, 1000);
9595+9696+testThrows('File requires new', () => File(['x'], 'f.txt'));
9797+testThrows('File requires 2 args', () => new File(['x']));
9898+9999+console.log('\nFile instanceof Blob\n');
100100+101101+test('File instanceof Blob', f1 instanceof Blob, true);
102102+test('File instanceof File', f1 instanceof File, true);
103103+test('Blob not instanceof File', b1 instanceof File, false);
104104+105105+const ft = await f1.text();
106106+test('File.text() works', ft, 'content');
107107+108108+console.log('\nSymbol.toStringTag\n');
109109+110110+test('Blob toStringTag', Object.prototype.toString.call(b1), '[object Blob]');
111111+test('File toStringTag', Object.prototype.toString.call(f1), '[object File]');
112112+113113+summary();
+114
examples/spec/headers.js
···11+import { test, testThrows, testDeep, summary } from './helpers.js';
22+33+console.log('Headers constructor\n');
44+55+const h0 = new Headers();
66+test('empty constructor', h0.has('x-foo'), false);
77+88+const h1 = new Headers({ 'Content-Type': 'text/html', 'x-custom': 'val' });
99+test('init from record', h1.get('content-type'), 'text/html');
1010+test('record key case-folded', h1.get('Content-Type'), 'text/html');
1111+1212+const h2 = new Headers([['x-a', '1'], ['x-b', '2']]);
1313+test('init from sequence', h2.get('x-a'), '1');
1414+test('init from sequence second', h2.get('x-b'), '2');
1515+1616+const h3 = new Headers(new Headers({ 'x-copy': 'yes' }));
1717+test('init from another Headers', h3.get('x-copy'), 'yes');
1818+1919+testThrows('requires new', () => Headers());
2020+testThrows('null init throws', () => new Headers(null));
2121+testThrows('string init throws', () => new Headers('bad'));
2222+testThrows('number init throws', () => new Headers(42));
2323+2424+console.log('\nappend / get / has / delete / set\n');
2525+2626+const h = new Headers();
2727+2828+h.append('x-foo', 'one');
2929+test('append then get', h.get('x-foo'), 'one');
3030+3131+h.append('x-foo', 'two');
3232+test('append combines values', h.get('x-foo'), 'one, two');
3333+3434+test('has returns true', h.has('x-foo'), true);
3535+test('has case-insensitive', h.has('X-FOO'), true);
3636+test('has missing returns false', h.has('x-bar'), false);
3737+3838+h.set('x-foo', 'replaced');
3939+test('set replaces combined value', h.get('x-foo'), 'replaced');
4040+4141+h.delete('x-foo');
4242+test('delete removes header', h.has('x-foo'), false);
4343+test('get deleted returns null', h.get('x-foo'), null);
4444+4545+console.log('\nset-cookie special case\n');
4646+4747+const hc = new Headers();
4848+hc.append('set-cookie', 'a=1');
4949+hc.append('set-cookie', 'b=2');
5050+test('set-cookie not combined', hc.get('set-cookie'), 'a=1');
5151+5252+const cookies = hc.getSetCookie ? hc.getSetCookie() : null;
5353+if (cookies) {
5454+ test('getSetCookie length', cookies.length, 2);
5555+ test('getSetCookie first', cookies[0], 'a=1');
5656+ test('getSetCookie second', cookies[1], 'b=2');
5757+}
5858+5959+console.log('\nvalue normalization\n');
6060+6161+const hn = new Headers();
6262+hn.set('x-trim', ' hello ');
6363+test('leading/trailing whitespace stripped', hn.get('x-trim'), 'hello');
6464+6565+hn.set('x-tab', '\thello\t');
6666+test('leading/trailing tab stripped', hn.get('x-tab'), 'hello');
6767+6868+console.log('\ninvalid name / value\n');
6969+7070+testThrows('empty name throws', () => h.set('', 'val'));
7171+testThrows('name with space throws', () => h.set('x bad', 'val'));
7272+testThrows('name with colon throws', () => h.set('x:bad', 'val'));
7373+7474+console.log('\nforEach\n');
7575+7676+const hf = new Headers({ 'b-key': 'bval', 'a-key': 'aval' });
7777+const seen = [];
7878+hf.forEach((val, name) => seen.push(`${name}:${val}`));
7979+test('forEach visits all entries', seen.length, 2);
8080+test('forEach sorted order', seen[0], 'a-key:aval');
8181+test('forEach sorted order 2', seen[1], 'b-key:bval');
8282+8383+console.log('\nentries / keys / values iteration\n');
8484+8585+const hi = new Headers({ 'b-hdr': '2', 'a-hdr': '1' });
8686+8787+const entries = [...hi.entries()];
8888+test('entries sorted', entries[0][0], 'a-hdr');
8989+test('entries value', entries[0][1], '1');
9090+test('entries length', entries.length, 2);
9191+9292+const keys = [...hi.keys()];
9393+test('keys sorted', keys[0], 'a-hdr');
9494+test('keys length', keys.length, 2);
9595+9696+const vals = [...hi.values()];
9797+test('values order matches keys', vals[0], '1');
9898+9999+console.log('\nlive iteration\n');
100100+101101+const hl = new Headers({ 'x-a': '1' });
102102+const iter = hl.entries();
103103+hl.set('x-b', '2');
104104+const all = [];
105105+for (const e of { [Symbol.iterator]: () => iter }) all.push(e[0]);
106106+test('live iterator sees added key', all.includes('x-b'), true);
107107+108108+console.log('\niterator prototype chain\n');
109109+110110+const it = new Headers().entries();
111111+const iterProto = Object.getPrototypeOf(Object.getPrototypeOf(it));
112112+test('iterator proto chain has Symbol.iterator', typeof iterProto[Symbol.iterator], 'function');
113113+114114+summary();