From 0daed248835d743dcfc320dc717c2b7de6834b17 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sun, 3 May 2015 15:05:43 -0700 Subject: [PATCH] Revert "url: delete href cache on all setter code paths" This reverts commit dbdd81a91bdce4cc59163e3be752dc3c53491987. It was agreed that this change contained too much potential ecosystem breakage, particularly around the inability to `delete` properties off a `Url` object. It may be re-introduced for a later release, along with better work on ecosystem compatibility. PR-URL: #1602 Reviewed-By: Mikeal Rogers Reviewed-By: Ben Noordhuis Reviewed-By: Forrest L Norvell Reviewed-By: Chris Dickinson Reviewed-By: Isaac Z. Schlueter Reviewed-By: Jeremiah Senkpiel --- lib/url.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/url.js b/lib/url.js index 52c39038767012..f5edd893335f91 100644 --- a/lib/url.js +++ b/lib/url.js @@ -1041,8 +1041,8 @@ Object.defineProperty(Url.prototype, 'host', { this._port = -1; this._hostname = this._host = encodeURIComponent(host); } + this._href = ''; } - this._href = ''; }, enumerable: true, configurable: true @@ -1068,8 +1068,9 @@ Object.defineProperty(Url.prototype, 'hostname', { this._host = hostname + ':' + this._port; else this._host = hostname; + + this._href = ''; } - this._href = ''; }, enumerable: true, configurable: true @@ -1088,8 +1089,8 @@ Object.defineProperty(Url.prototype, 'hash', { hash = '#' + hash; } this._hash = hash; + this._href = ''; } - this._href = ''; }, enumerable: true, configurable: true @@ -1113,8 +1114,8 @@ Object.defineProperty(Url.prototype, 'search', { if (this._parsesQueryStrings) { this.query = querystring.parse(search.slice(1)); } + this._href = ''; } - this._href = ''; }, enumerable: true, configurable: true @@ -1137,8 +1138,8 @@ Object.defineProperty(Url.prototype, 'pathname', { } this._pathname = pathname; + this._href = ''; } - this._href = ''; }, enumerable: true, configurable: true