summaryrefslogtreecommitdiff
path: root/test/parallel/test-net-server-options.js
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2015-09-13 19:49:35 -0700
committerBenjamin Gruenbaum <inglor@gmail.com>2016-03-15 10:50:02 +0200
commita78b3344f8bc7e6ca6afb37326347d68fe21b062 (patch)
tree4616ce884818325d7f6865a1151fe9ddc5c89148 /test/parallel/test-net-server-options.js
parentb801e39266b815baaf264167753bdc0bb7394489 (diff)
downloadandroid-node-v8-a78b3344f8bc7e6ca6afb37326347d68fe21b062.tar.gz
android-node-v8-a78b3344f8bc7e6ca6afb37326347d68fe21b062.tar.bz2
android-node-v8-a78b3344f8bc7e6ca6afb37326347d68fe21b062.zip
net: type check createServer options object
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>
Diffstat (limited to 'test/parallel/test-net-server-options.js')
-rw-r--r--test/parallel/test-net-server-options.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-net-server-options.js b/test/parallel/test-net-server-options.js
new file mode 100644
index 0000000000..1445c3e6b8
--- /dev/null
+++ b/test/parallel/test-net-server-options.js
@@ -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);