mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 11:04:30 +00:00

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>
8 lines
255 B
JavaScript
8 lines
255 B
JavaScript
'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);
|