1'use strict'; 2 3const common = require('../common'); 4if (!common.hasCrypto) 5 common.skip('missing crypto'); 6 7const assert = require('assert'); 8const net = require('net'); 9const tls = require('tls'); 10const tty = require('tty'); 11 12// Check that the bytesWritten getter doesn't crash if object isn't 13// constructed. 14assert.strictEqual(net.Socket.prototype.bytesWritten, undefined); 15assert.strictEqual(Object.getPrototypeOf(tls.TLSSocket).prototype.bytesWritten, 16 undefined); 17assert.strictEqual(tls.TLSSocket.prototype.bytesWritten, undefined); 18assert.strictEqual(Object.getPrototypeOf(tty.ReadStream).prototype.bytesWritten, 19 undefined); 20assert.strictEqual(tty.ReadStream.prototype.bytesWritten, undefined); 21assert.strictEqual(tty.WriteStream.prototype.bytesWritten, undefined); 22