зеркало из https://github.com/mozilla/gecko-dev.git
Fix almost-10-year-old lastIndex bug reported by Sjoerd Visscher <sjoerd@w3future.com> (283477, r=me).
This commit is contained in:
Родитель
b4253dd8a0
Коммит
c1fb1d98d2
|
@ -1039,8 +1039,8 @@ str_lastIndexOf(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||||
d = js_DoubleToInteger(d);
|
d = js_DoubleToInteger(d);
|
||||||
if (d < 0)
|
if (d < 0)
|
||||||
i = 0;
|
i = 0;
|
||||||
else if (d > textlen - patlen)
|
else if (d > textlen)
|
||||||
i = textlen - patlen;
|
i = textlen;
|
||||||
else
|
else
|
||||||
i = (jsint)d;
|
i = (jsint)d;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче