2017-05-06 12:20:52 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
2020-11-09 21:25:30 +00:00
|
|
|
const { Writable, addAbortSignal } = require('stream');
|
2017-05-06 12:20:52 +00:00
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('finish', common.mustNotCall());
|
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
|
|
|
|
write.destroy();
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
2019-08-24 14:33:46 +00:00
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) {
|
|
|
|
this.destroy(new Error('asd'));
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
write.on('error', common.mustCall());
|
|
|
|
write.on('finish', common.mustNotCall());
|
|
|
|
write.end('asd');
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
2017-05-06 12:20:52 +00:00
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
const expected = new Error('kaboom');
|
|
|
|
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('finish', common.mustNotCall());
|
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
write.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, expected);
|
|
|
|
}));
|
|
|
|
|
|
|
|
write.destroy(expected);
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write._destroy = function(err, cb) {
|
|
|
|
assert.strictEqual(err, expected);
|
|
|
|
cb(err);
|
|
|
|
};
|
|
|
|
|
|
|
|
const expected = new Error('kaboom');
|
|
|
|
|
|
|
|
write.on('finish', common.mustNotCall('no finish event'));
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
write.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, expected);
|
|
|
|
}));
|
|
|
|
|
|
|
|
write.destroy(expected);
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); },
|
|
|
|
destroy: common.mustCall(function(err, cb) {
|
|
|
|
assert.strictEqual(err, expected);
|
|
|
|
cb();
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
const expected = new Error('kaboom');
|
|
|
|
|
|
|
|
write.on('finish', common.mustNotCall('no finish event'));
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
|
2019-01-21 00:22:27 +00:00
|
|
|
// Error is swallowed by the custom _destroy
|
2017-05-06 12:20:52 +00:00
|
|
|
write.on('error', common.mustNotCall('no error event'));
|
|
|
|
|
|
|
|
write.destroy(expected);
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write._destroy = common.mustCall(function(err, cb) {
|
|
|
|
assert.strictEqual(err, null);
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
|
|
|
|
write.destroy();
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write._destroy = common.mustCall(function(err, cb) {
|
|
|
|
assert.strictEqual(err, null);
|
|
|
|
process.nextTick(() => {
|
|
|
|
this.end();
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const fail = common.mustNotCall('no finish event');
|
|
|
|
|
|
|
|
write.on('finish', fail);
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
|
|
|
|
write.destroy();
|
|
|
|
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
const expected = new Error('kaboom');
|
|
|
|
|
|
|
|
write._destroy = common.mustCall(function(err, cb) {
|
|
|
|
assert.strictEqual(err, null);
|
|
|
|
cb(expected);
|
|
|
|
});
|
|
|
|
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('close', common.mustCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
write.on('finish', common.mustNotCall('no finish event'));
|
|
|
|
write.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, expected);
|
|
|
|
}));
|
|
|
|
|
|
|
|
write.destroy();
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
// double error case
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
2019-12-08 08:12:14 +00:00
|
|
|
let ticked = false;
|
|
|
|
write.on('close', common.mustCall(() => {
|
|
|
|
assert.strictEqual(ticked, true);
|
|
|
|
}));
|
|
|
|
write.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(ticked, true);
|
|
|
|
assert.strictEqual(err.message, 'kaboom 1');
|
|
|
|
assert.strictEqual(write._writableState.errorEmitted, true);
|
|
|
|
}));
|
2017-05-06 12:20:52 +00:00
|
|
|
|
2020-06-28 16:43:59 +00:00
|
|
|
const expected = new Error('kaboom 1');
|
|
|
|
write.destroy(expected);
|
2017-05-06 12:20:52 +00:00
|
|
|
write.destroy(new Error('kaboom 2'));
|
2020-06-28 16:43:59 +00:00
|
|
|
assert.strictEqual(write._writableState.errored, expected);
|
2019-12-08 08:12:14 +00:00
|
|
|
assert.strictEqual(write._writableState.errorEmitted, false);
|
2017-05-06 12:20:52 +00:00
|
|
|
assert.strictEqual(write.destroyed, true);
|
2019-12-08 08:12:14 +00:00
|
|
|
ticked = true;
|
2017-05-06 12:20:52 +00:00
|
|
|
}
|
|
|
|
|
2019-02-12 18:24:39 +00:00
|
|
|
{
|
|
|
|
const writable = new Writable({
|
|
|
|
destroy: common.mustCall(function(err, cb) {
|
|
|
|
process.nextTick(cb, new Error('kaboom 1'));
|
|
|
|
}),
|
|
|
|
write(chunk, enc, cb) {
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-12-08 08:12:14 +00:00
|
|
|
let ticked = false;
|
|
|
|
writable.on('close', common.mustCall(() => {
|
2019-08-18 21:38:35 +00:00
|
|
|
writable.on('error', common.mustNotCall());
|
|
|
|
writable.destroy(new Error('hello'));
|
2019-12-08 08:12:14 +00:00
|
|
|
assert.strictEqual(ticked, true);
|
|
|
|
assert.strictEqual(writable._writableState.errorEmitted, true);
|
|
|
|
}));
|
|
|
|
writable.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(ticked, true);
|
2019-08-18 21:38:35 +00:00
|
|
|
assert.strictEqual(err.message, 'kaboom 1');
|
2019-12-08 08:12:14 +00:00
|
|
|
assert.strictEqual(writable._writableState.errorEmitted, true);
|
2019-02-12 18:24:39 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
writable.destroy();
|
|
|
|
assert.strictEqual(writable.destroyed, true);
|
2020-06-28 16:43:59 +00:00
|
|
|
assert.strictEqual(writable._writableState.errored, null);
|
2019-02-12 18:24:39 +00:00
|
|
|
assert.strictEqual(writable._writableState.errorEmitted, false);
|
|
|
|
|
|
|
|
// Test case where `writable.destroy()` is called again with an error before
|
|
|
|
// the `_destroy()` callback is called.
|
|
|
|
writable.destroy(new Error('kaboom 2'));
|
2019-12-08 08:12:14 +00:00
|
|
|
assert.strictEqual(writable._writableState.errorEmitted, false);
|
2020-06-28 16:43:59 +00:00
|
|
|
assert.strictEqual(writable._writableState.errored, null);
|
2019-12-08 08:12:14 +00:00
|
|
|
|
|
|
|
ticked = true;
|
2019-02-12 18:24:39 +00:00
|
|
|
}
|
|
|
|
|
2017-05-06 12:20:52 +00:00
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.destroyed = true;
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
|
2018-12-10 12:27:32 +00:00
|
|
|
// The internal destroy() mechanism should not be triggered
|
2018-01-29 18:32:34 +00:00
|
|
|
write.on('close', common.mustNotCall());
|
2017-05-06 12:20:52 +00:00
|
|
|
write.destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
function MyWritable() {
|
|
|
|
assert.strictEqual(this.destroyed, false);
|
|
|
|
this.destroyed = false;
|
|
|
|
Writable.call(this);
|
|
|
|
}
|
|
|
|
|
2018-12-28 04:10:45 +00:00
|
|
|
Object.setPrototypeOf(MyWritable.prototype, Writable.prototype);
|
|
|
|
Object.setPrototypeOf(MyWritable, Writable);
|
2017-05-06 12:20:52 +00:00
|
|
|
|
|
|
|
new MyWritable();
|
|
|
|
}
|
2017-05-22 16:03:55 +00:00
|
|
|
|
|
|
|
{
|
2019-03-22 02:44:26 +00:00
|
|
|
// Destroy and destroy callback
|
2017-05-22 16:03:55 +00:00
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.destroy();
|
|
|
|
|
|
|
|
const expected = new Error('kaboom');
|
|
|
|
|
2019-08-18 21:38:35 +00:00
|
|
|
write.destroy(expected, common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, undefined);
|
2017-05-22 16:03:55 +00:00
|
|
|
}));
|
|
|
|
}
|
2018-02-07 00:36:20 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// Checks that `._undestroy()` restores the state so that `final` will be
|
|
|
|
// called again.
|
|
|
|
const write = new Writable({
|
|
|
|
write: common.mustNotCall(),
|
2019-11-30 14:39:44 +00:00
|
|
|
final: common.mustCall((cb) => cb(), 2),
|
|
|
|
autoDestroy: true
|
2018-02-07 00:36:20 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
write.end();
|
2019-11-30 14:39:44 +00:00
|
|
|
write.once('close', common.mustCall(() => {
|
|
|
|
write._undestroy();
|
|
|
|
write.end();
|
|
|
|
}));
|
2018-02-07 00:36:20 +00:00
|
|
|
}
|
2019-08-06 20:16:05 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable();
|
|
|
|
|
|
|
|
write.destroy();
|
2019-08-18 21:38:35 +00:00
|
|
|
write.on('error', common.mustNotCall());
|
2019-08-06 20:16:05 +00:00
|
|
|
write.write('asd', common.expectsError({
|
2019-12-25 17:02:16 +00:00
|
|
|
name: 'Error',
|
2019-08-06 20:16:05 +00:00
|
|
|
code: 'ERR_STREAM_DESTROYED',
|
|
|
|
message: 'Cannot call write after a stream was destroyed'
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
2019-08-18 21:38:35 +00:00
|
|
|
write.on('error', common.mustNotCall());
|
2019-08-06 20:16:05 +00:00
|
|
|
|
|
|
|
write.cork();
|
|
|
|
write.write('asd', common.mustCall());
|
|
|
|
write.uncork();
|
|
|
|
|
|
|
|
write.cork();
|
|
|
|
write.write('asd', common.expectsError({
|
2019-12-25 17:02:16 +00:00
|
|
|
name: 'Error',
|
2019-08-06 20:16:05 +00:00
|
|
|
code: 'ERR_STREAM_DESTROYED',
|
|
|
|
message: 'Cannot call write after a stream was destroyed'
|
|
|
|
}));
|
|
|
|
write.destroy();
|
|
|
|
write.write('asd', common.expectsError({
|
2019-12-25 17:02:16 +00:00
|
|
|
name: 'Error',
|
2019-08-06 20:16:05 +00:00
|
|
|
code: 'ERR_STREAM_DESTROYED',
|
|
|
|
message: 'Cannot call write after a stream was destroyed'
|
|
|
|
}));
|
|
|
|
write.uncork();
|
|
|
|
}
|
2019-09-28 08:24:56 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// Call end(cb) after error & destroy
|
|
|
|
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(new Error('asd')); }
|
|
|
|
});
|
|
|
|
write.on('error', common.mustCall(() => {
|
|
|
|
write.destroy();
|
|
|
|
let ticked = false;
|
|
|
|
write.end(common.mustCall((err) => {
|
|
|
|
assert.strictEqual(ticked, true);
|
|
|
|
assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED');
|
|
|
|
}));
|
|
|
|
ticked = true;
|
|
|
|
}));
|
|
|
|
write.write('asd');
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
// Call end(cb) after finish & destroy
|
|
|
|
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
write.on('finish', common.mustCall(() => {
|
|
|
|
write.destroy();
|
|
|
|
let ticked = false;
|
|
|
|
write.end(common.mustCall((err) => {
|
2019-09-28 05:33:47 +00:00
|
|
|
assert.strictEqual(ticked, true);
|
2019-09-28 08:24:56 +00:00
|
|
|
assert.strictEqual(err.code, 'ERR_STREAM_ALREADY_FINISHED');
|
|
|
|
}));
|
|
|
|
ticked = true;
|
|
|
|
}));
|
|
|
|
write.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
// Call end(cb) after error & destroy and don't trigger
|
|
|
|
// unhandled exception.
|
|
|
|
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { process.nextTick(cb); }
|
|
|
|
});
|
2021-07-12 07:42:50 +00:00
|
|
|
const _err = new Error('asd');
|
2019-09-28 08:24:56 +00:00
|
|
|
write.once('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err.message, 'asd');
|
|
|
|
}));
|
|
|
|
write.end('asd', common.mustCall((err) => {
|
2021-07-12 07:42:50 +00:00
|
|
|
assert.strictEqual(err, _err);
|
2019-09-28 08:24:56 +00:00
|
|
|
}));
|
2021-07-12 07:42:50 +00:00
|
|
|
write.destroy(_err);
|
2019-09-28 08:24:56 +00:00
|
|
|
}
|
2019-11-22 18:13:00 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// Call buffered write callback with error
|
|
|
|
|
2021-07-12 07:42:50 +00:00
|
|
|
const _err = new Error('asd');
|
2019-11-22 18:13:00 +00:00
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) {
|
2021-07-12 07:42:50 +00:00
|
|
|
process.nextTick(cb, _err);
|
2019-11-22 18:13:00 +00:00
|
|
|
},
|
|
|
|
autoDestroy: false
|
|
|
|
});
|
|
|
|
write.cork();
|
|
|
|
write.write('asd', common.mustCall((err) => {
|
2021-07-12 07:42:50 +00:00
|
|
|
assert.strictEqual(err, _err);
|
2019-11-22 18:13:00 +00:00
|
|
|
}));
|
|
|
|
write.write('asd', common.mustCall((err) => {
|
2021-07-12 07:42:50 +00:00
|
|
|
assert.strictEqual(err, _err);
|
2019-11-22 18:13:00 +00:00
|
|
|
}));
|
|
|
|
write.on('error', common.mustCall((err) => {
|
2021-07-12 07:42:50 +00:00
|
|
|
assert.strictEqual(err, _err);
|
2019-11-22 18:13:00 +00:00
|
|
|
}));
|
|
|
|
write.uncork();
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
// Ensure callback order.
|
|
|
|
|
|
|
|
let state = 0;
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) {
|
|
|
|
// `setImmediate()` is used on purpose to ensure the callback is called
|
|
|
|
// after `process.nextTick()` callbacks.
|
|
|
|
setImmediate(cb);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
write.write('asd', common.mustCall(() => {
|
|
|
|
assert.strictEqual(state++, 0);
|
|
|
|
}));
|
|
|
|
write.write('asd', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED');
|
|
|
|
assert.strictEqual(state++, 1);
|
|
|
|
}));
|
|
|
|
write.destroy();
|
|
|
|
}
|
2020-06-28 16:43:59 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
autoDestroy: false,
|
|
|
|
write(chunk, enc, cb) {
|
|
|
|
cb();
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
write.on('error', common.mustCall(() => {
|
|
|
|
assert(write._writableState.errored);
|
|
|
|
}));
|
|
|
|
write.write('asd');
|
|
|
|
}
|
2020-11-09 21:25:30 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
const ac = new AbortController();
|
|
|
|
const write = addAbortSignal(ac.signal, new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
}));
|
|
|
|
|
|
|
|
write.on('error', common.mustCall((e) => {
|
|
|
|
assert.strictEqual(e.name, 'AbortError');
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}));
|
|
|
|
write.write('asd');
|
|
|
|
ac.abort();
|
|
|
|
}
|
2020-12-07 16:42:46 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
const ac = new AbortController();
|
|
|
|
const write = new Writable({
|
|
|
|
signal: ac.signal,
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.on('error', common.mustCall((e) => {
|
|
|
|
assert.strictEqual(e.name, 'AbortError');
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}));
|
|
|
|
write.write('asd');
|
|
|
|
ac.abort();
|
|
|
|
}
|
2020-12-16 12:24:09 +00:00
|
|
|
|
|
|
|
{
|
2021-03-18 16:52:08 +00:00
|
|
|
const signal = AbortSignal.abort();
|
2020-12-16 12:24:09 +00:00
|
|
|
|
|
|
|
const write = new Writable({
|
2021-03-18 16:52:08 +00:00
|
|
|
signal,
|
2020-12-16 12:24:09 +00:00
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.on('error', common.mustCall((e) => {
|
|
|
|
assert.strictEqual(e.name, 'AbortError');
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}));
|
|
|
|
}
|
2021-04-12 22:54:24 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// Destroy twice
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.end(common.mustCall());
|
|
|
|
write.destroy();
|
|
|
|
write.destroy();
|
|
|
|
}
|
2021-07-12 07:42:50 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// https://github.com/nodejs/node/issues/39356
|
|
|
|
const s = new Writable({
|
|
|
|
final() {}
|
|
|
|
});
|
|
|
|
const _err = new Error('oh no');
|
|
|
|
// Remove `callback` and it works
|
|
|
|
s.end(common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, _err);
|
|
|
|
}));
|
|
|
|
s.on('error', common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err, _err);
|
|
|
|
}));
|
|
|
|
s.destroy(_err);
|
|
|
|
}
|
2024-06-15 23:41:59 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
const write = new Writable({
|
|
|
|
write(chunk, enc, cb) { cb(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
write.on('error', common.mustCall((e) => {
|
|
|
|
assert.strictEqual(e.name, 'AbortError');
|
|
|
|
assert.strictEqual(write.destroyed, true);
|
|
|
|
}));
|
|
|
|
write[Symbol.asyncDispose]().then(common.mustCall());
|
|
|
|
}
|