mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
6e86a6651c
Complete the migration to the new error system of _stream_readable and _stream_writable. Adds the corresponding documentation. PR-URL: https://github.com/nodejs/node/pull/16589 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
20 lines
375 B
JavaScript
20 lines
375 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const stream = require('stream');
|
|
|
|
const readable = new stream.Readable({
|
|
read: () => {}
|
|
});
|
|
|
|
function checkError(fn) {
|
|
common.expectsError(fn, {
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError
|
|
});
|
|
}
|
|
|
|
checkError(() => readable.push([]));
|
|
checkError(() => readable.push({}));
|
|
checkError(() => readable.push(0));
|