url: fix treatment of some values as non-empty
authorPetka Antonov <petka_antonov@hotmail.com>
Sun, 3 May 2015 08:29:54 +0000 (11:29 +0300)
committerPetka Antonov <petka_antonov@hotmail.com>
Sun, 3 May 2015 08:29:54 +0000 (11:29 +0300)
commit66877216bd833face753d9a5d573ad477895d880
treec0e510265d0a37f7d596d5e897e462c263256ba4
parentdbdd81a91bdce4cc59163e3be752dc3c53491987
url: fix treatment of some values as non-empty

In addition to null, undefined and the empty string
are treated as empty (removing the component from the url).

The string '#' is treated same as empty values when
setting .hash.

The string '?' is treated same as empty values when
setting .search.

PR-URL: https://github.com/iojs/io.js/pull/1589
Fixes: https://github.com/iojs/io.js/issues/1588
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/url.js
test/parallel/test-url-accessors.js