Skip to content

Commit 0daed24

Browse files
committed
Revert "url: delete href cache on all setter code paths"
This reverts commit dbdd81a. 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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Forrest L Norvell <[email protected]> Reviewed-By: Chris Dickinson <[email protected]> Reviewed-By: Isaac Z. Schlueter <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 0f39ef4 commit 0daed24

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/url.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ Object.defineProperty(Url.prototype, 'host', {
10411041
this._port = -1;
10421042
this._hostname = this._host = encodeURIComponent(host);
10431043
}
1044+
this._href = '';
10441045
}
1045-
this._href = '';
10461046
},
10471047
enumerable: true,
10481048
configurable: true
@@ -1068,8 +1068,9 @@ Object.defineProperty(Url.prototype, 'hostname', {
10681068
this._host = hostname + ':' + this._port;
10691069
else
10701070
this._host = hostname;
1071+
1072+
this._href = '';
10711073
}
1072-
this._href = '';
10731074
},
10741075
enumerable: true,
10751076
configurable: true
@@ -1088,8 +1089,8 @@ Object.defineProperty(Url.prototype, 'hash', {
10881089
hash = '#' + hash;
10891090
}
10901091
this._hash = hash;
1092+
this._href = '';
10911093
}
1092-
this._href = '';
10931094
},
10941095
enumerable: true,
10951096
configurable: true
@@ -1113,8 +1114,8 @@ Object.defineProperty(Url.prototype, 'search', {
11131114
if (this._parsesQueryStrings) {
11141115
this.query = querystring.parse(search.slice(1));
11151116
}
1117+
this._href = '';
11161118
}
1117-
this._href = '';
11181119
},
11191120
enumerable: true,
11201121
configurable: true
@@ -1137,8 +1138,8 @@ Object.defineProperty(Url.prototype, 'pathname', {
11371138
}
11381139

11391140
this._pathname = pathname;
1141+
this._href = '';
11401142
}
1141-
this._href = '';
11421143
},
11431144
enumerable: true,
11441145
configurable: true

0 commit comments

Comments
 (0)