mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 05:09:36 +00:00

PR-URL: https://github.com/nodejs/node/pull/11049 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
21 lines
442 B
JavaScript
21 lines
442 B
JavaScript
/* eslint-disable max-len */
|
|
'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({}), '');
|