Bug 664009 - Fix a minor array bug that happens to break some code. r=jwalden, a=clegnitto

This commit is contained in:
Brendan Eich
2011-06-14 16:07:29 -07:00
parent bee9732e3d
commit c4192c819e

View File

@@ -2806,7 +2806,8 @@ array_extra(JSContext *cx, ArrayExtraMode mode, uintN argc, Value *vp)
newlen = 0;
newarr = NULL;
#endif
jsint start = 0, end = length, step = 1;
jsuint start = 0, end = length;
jsint step = 1;
switch (mode) {
case REDUCE_RIGHT:
@@ -2875,7 +2876,7 @@ array_extra(JSContext *cx, ArrayExtraMode mode, uintN argc, Value *vp)
Value objv = ObjectValue(*obj);
AutoValueRooter tvr(cx);
for (jsint i = start; i != end; i += step) {
for (jsuint i = start; i != end; i += step) {
JSBool hole;
ok = JS_CHECK_OPERATION_LIMIT(cx) &&
GetElement(cx, obj, i, &hole, tvr.addr());