function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url && typeof(url) === 'object' && url.href) return url;
+ if (typeof url !== 'string') {
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
+ }
+
var out = {},
rest = url;
});
+// https://github.com/joyent/node/issues/568
+[
+ undefined,
+ null,
+ true,
+ false,
+ 0.0,
+ 0,
+ [],
+ {}
+].forEach(function(val) {
+ assert.throws(function() { url.parse(val); }, TypeError);
+});
+
+
//
// Tests below taken from Chiron
// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js