Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /compression/decompression-constructor-error.tentative.any.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.shadowrealm-in-dedicatedworker.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.shadowrealm-in-shadowrealm.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.shadowrealm-in-sharedworker.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.shadowrealm-in-window.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.any.worker.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.https.any.shadowrealm-in-audioworklet.html - WPT Dashboard Interop Dashboard
- /compression/decompression-constructor-error.tentative.https.any.shadowrealm-in-serviceworker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker,shadowrealm
'use strict';
test(t => {
assert_throws_js(TypeError, () => new DecompressionStream('a'), 'constructor should throw');
}, '"a" should cause the constructor to throw');
test(t => {
assert_throws_js(TypeError, () => new DecompressionStream(), 'constructor should throw');
}, 'no input should cause the constructor to throw');
test(t => {
assert_throws_js(Error, () => new DecompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
}, 'non-string input should cause the constructor to throw');