mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
a713024579
If bytesWritten is accessed before the object has been properly constructed then return undefined. Fixes: https://github.com/nodejs/node/issues/3298 PR-URL: https://github.com/nodejs/node/pull/3305 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
17 lines
669 B
JavaScript
17 lines
669 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
const tls = require('tls');
|
|
const tty = require('tty');
|
|
|
|
// Check that the bytesWritten getter doesn't crash if object isn't
|
|
// constructed.
|
|
assert.strictEqual(net.Socket.prototype.bytesWritten, undefined);
|
|
assert.strictEqual(tls.TLSSocket.super_.prototype.bytesWritten, undefined);
|
|
assert.strictEqual(tls.TLSSocket.prototype.bytesWritten, undefined);
|
|
assert.strictEqual(tty.ReadStream.super_.prototype.bytesWritten, undefined);
|
|
assert.strictEqual(tty.ReadStream.prototype.bytesWritten, undefined);
|
|
assert.strictEqual(tty.WriteStream.prototype.bytesWritten, undefined);
|