Skip to content

Commit dbdd81a

Browse files
committed
url: delete href cache on all setter code paths
PR-URL: #1589 Fixes: #1588 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent b4f5898 commit dbdd81a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/url.js

+5-6
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 = '';
10451044
}
1045+
this._href = '';
10461046
},
10471047
enumerable: true,
10481048
configurable: true
@@ -1068,9 +1068,8 @@ Object.defineProperty(Url.prototype, 'hostname', {
10681068
this._host = hostname + ':' + this._port;
10691069
else
10701070
this._host = hostname;
1071-
1072-
this._href = '';
10731071
}
1072+
this._href = '';
10741073
},
10751074
enumerable: true,
10761075
configurable: true
@@ -1089,8 +1088,8 @@ Object.defineProperty(Url.prototype, 'hash', {
10891088
hash = '#' + hash;
10901089
}
10911090
this._hash = hash;
1092-
this._href = '';
10931091
}
1092+
this._href = '';
10941093
},
10951094
enumerable: true,
10961095
configurable: true
@@ -1114,8 +1113,8 @@ Object.defineProperty(Url.prototype, 'search', {
11141113
if (this._parsesQueryStrings) {
11151114
this.query = querystring.parse(search.slice(1));
11161115
}
1117-
this._href = '';
11181116
}
1117+
this._href = '';
11191118
},
11201119
enumerable: true,
11211120
configurable: true
@@ -1138,8 +1137,8 @@ Object.defineProperty(Url.prototype, 'pathname', {
11381137
}
11391138

11401139
this._pathname = pathname;
1141-
this._href = '';
11421140
}
1141+
this._href = '';
11431142
},
11441143
enumerable: true,
11451144
configurable: true

0 commit comments

Comments
 (0)