url: make query() consistent
authorGabriel Wicke <wicke@wikidev.net>
Thu, 25 Sep 2014 16:59:18 +0000 (09:59 -0700)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 1 Oct 2014 19:23:01 +0000 (12:23 -0700)
commitb705b73e46193c7691be40b732330a49affacedb
tree9c02144948715fcb0b38ab379cea386d3438d609
parentac2857b12cd819b68405b15c3f8e95e48bcc32d8
url: make query() consistent

Match the behavior of the slow path by setting url.query to an empty
object when the url contains no query, but query parsing is requested.

Also add a test for this case, and update the documents to clearly
reflect this behavior.

Fixes: https://github.com/joyent/node/issues/8332
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
doc/api/url.markdown
lib/url.js
test/simple/test-url.js