summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-01-30 23:40:29 +0100
committerTobias Nießen <tniessen@tnie.de>2018-01-31 18:36:43 +0100
commit26ce1ae647d75dfda2359412cc7add0c26f77484 (patch)
tree68a550267baf8921507ed18e23e471aefb6d7e00 /lib/url.js
parent312414662b678d95bee2904348e053728993b97a (diff)
downloadandroid-node-v8-26ce1ae647d75dfda2359412cc7add0c26f77484.tar.gz
android-node-v8-26ce1ae647d75dfda2359412cc7add0c26f77484.tar.bz2
android-node-v8-26ce1ae647d75dfda2359412cc7add0c26f77484.zip
url: simplify loop in parser
PR-URL: https://github.com/nodejs/node/pull/18468 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.js b/lib/url.js
index d27891d36b..cb524fd9a8 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -883,7 +883,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
// if the path is allowed to go above the root, restore leading ..s
if (!mustEndAbs && !removeAllDots) {
- for (; up--; up) {
+ while (up--) {
srcPath.unshift('..');
}
}