mirror of https://github.com/lukechilds/node.git
Browse Source
net.createServer('aPipe') and net.createServer(8080) are mistakes, and now throw a TypeError instead of silently being treated as an object. PR-URL: https://github.com/nodejs/node/pull/2904 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>process-exit-stdio-flushing
Sam Roberts
9 years ago
committed by
Benjamin Gruenbaum
2 changed files with 10 additions and 1 deletions
@ -0,0 +1,7 @@ |
|||||
|
'use strict'; |
||||
|
const common = require('../common'); |
||||
|
const assert = require('assert'); |
||||
|
const net = require('net'); |
||||
|
|
||||
|
assert.throws(function() { net.createServer('path'); }, TypeError); |
||||
|
assert.throws(function() { net.createServer(common.PORT); }, TypeError); |
Loading…
Reference in new issue