mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
84f3b8f09f
Also, add tests to ensure they will always return this, and to confirm they return this when these doc changes are back-ported to earlier release lines. PR-URL: https://github.com/nodejs/node/pull/13531 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
27 lines
559 B
JavaScript
27 lines
559 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const uv = process.binding('uv');
|
|
|
|
const s = new net.Socket({
|
|
handle: {
|
|
readStart: function() {
|
|
process.nextTick(() => this.onread(uv.UV_EOF, null));
|
|
},
|
|
close: (cb) => process.nextTick(cb)
|
|
},
|
|
writable: false
|
|
});
|
|
assert.strictEqual(s, s.resume());
|
|
|
|
const events = [];
|
|
|
|
s.on('end', () => events.push('end'));
|
|
s.on('close', () => events.push('close'));
|
|
|
|
process.on('exit', () => {
|
|
assert.deepStrictEqual(events, [ 'end', 'close' ]);
|
|
});
|