mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
1f209129c7
Logic errors that do not depend on stream state should throw instead of invoke callback and emit error. PR-URL: https://github.com/nodejs/node/pull/31831 Refs: https://github.com/nodejs/node/pull/31818 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
15 lines
317 B
JavaScript
15 lines
317 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Gunzip } = require('zlib');
|
|
|
|
const gunzip = new Gunzip({ objectMode: true });
|
|
gunzip.on('error', common.mustNotCall());
|
|
assert.throws(() => {
|
|
gunzip.write({});
|
|
}, {
|
|
name: 'TypeError',
|
|
code: 'ERR_INVALID_ARG_TYPE'
|
|
});
|