net: don't throw on bytesWritten access
authorTrevor Norris <trev.norris@gmail.com>
Fri, 9 Oct 2015 22:51:42 +0000 (16:51 -0600)
committerJames M Snell <jasnell@gmail.com>
Mon, 12 Oct 2015 17:25:49 +0000 (10:25 -0700)
commit01cb3fc36b0ca5f6e24ccb47915487e7c6a0e609
tree28e7c3c5317dd010f35790ccc544e53d47269a06
parent42b936e78ddb0131ad620c8cc87acf1f1f5325d9
net: don't throw on bytesWritten access

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>
lib/net.js
test/parallel/test-net-access-byteswritten.js [new file with mode: 0644]