11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciif (!common.hasCrypto) 51cb0ef41Sopenharmony_ci common.skip('missing crypto'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst assert = require('assert'); 81cb0ef41Sopenharmony_ciconst net = require('net'); 91cb0ef41Sopenharmony_ciconst tls = require('tls'); 101cb0ef41Sopenharmony_ciconst tty = require('tty'); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci// Check that the bytesWritten getter doesn't crash if object isn't 131cb0ef41Sopenharmony_ci// constructed. 141cb0ef41Sopenharmony_ciassert.strictEqual(net.Socket.prototype.bytesWritten, undefined); 151cb0ef41Sopenharmony_ciassert.strictEqual(Object.getPrototypeOf(tls.TLSSocket).prototype.bytesWritten, 161cb0ef41Sopenharmony_ci undefined); 171cb0ef41Sopenharmony_ciassert.strictEqual(tls.TLSSocket.prototype.bytesWritten, undefined); 181cb0ef41Sopenharmony_ciassert.strictEqual(Object.getPrototypeOf(tty.ReadStream).prototype.bytesWritten, 191cb0ef41Sopenharmony_ci undefined); 201cb0ef41Sopenharmony_ciassert.strictEqual(tty.ReadStream.prototype.bytesWritten, undefined); 211cb0ef41Sopenharmony_ciassert.strictEqual(tty.WriteStream.prototype.bytesWritten, undefined); 22