Skip to content

Commit

Permalink
config: null uri props in nerf-dart
Browse files Browse the repository at this point in the history
Deleting uri properties will not work anymore in io.js 2.0.0 as the
properties are now getters/setters and deleting them will delete the
getters/setters themselves from the instance. Nulling the properties
has the same effect, while also bringing a performance gain over delete.

Related: nodejs/node#1591
  • Loading branch information
silverwind committed May 2, 2015
1 parent d18d784 commit a43a152
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/config/nerf-dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ module.exports = toNerfDart
*/
function toNerfDart(uri) {
var parsed = url.parse(uri)
delete parsed.protocol
delete parsed.auth
delete parsed.query
delete parsed.search
delete parsed.hash
parsed.protocol = null
parsed.auth = null
parsed.query = null
parsed.search = null
parsed.hash = null

return url.resolve(url.format(parsed), ".")
}

0 comments on commit a43a152

Please sign in to comment.