mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
413 B
20 lines
413 B
8 years ago
|
'use strict';
|
||
|
require('../common');
|
||
|
const assert = require('assert');
|
||
|
const url = require('url');
|
||
|
|
||
|
// https://github.com/nodejs/node/pull/1036
|
||
|
const throws = [
|
||
|
undefined,
|
||
|
null,
|
||
|
true,
|
||
|
false,
|
||
|
0,
|
||
|
function() {}
|
||
|
];
|
||
|
for (let i = 0; i < throws.length; i++) {
|
||
|
assert.throws(function() { url.format(throws[i]); }, TypeError);
|
||
|
}
|
||
|
assert.strictEqual(url.format(''), '');
|
||
|
assert.strictEqual(url.format({}), '');
|