joyent/node — pull request #3979 by dscape (2012-09-07 18:35:51+00:00)
Title: url: Fixes `resolve` to work as documented

`url.resolve` with arity of one (e.g. url.resolve({host:"localhost"}))
would throw because the relative would be `null` and `null` has
no properties

``` js
url.js:322
var auth = obj.auth || ;
^
TypeError: Cannot read property auth of undefined
at urlFormat (url.js:322:17)
at urlResolveObject (url.js:379:23)
at Object.urlResolve [as resolve] (url.js:372:20)
at Object. (/Users/dscape/Desktop/dev/node/test/simple/test-url-resolve.js:28:18)
at Module._compile (module.js:454:26)
at Object.Module._extensions..js (module.js:472:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:497:10)
at process.startup.processNextTick.process._tickCallback (node.js:325:13)
```

This fix resolves that problem by making sure that if a `relative`
doesnt exist it defaults to empty object