Back out 72ac46e9f64e for orange. r=bustage

This commit is contained in:
Jeff Walden
2011-01-11 15:04:36 -06:00
parent c0193e9b72
commit d757bdb687
3 changed files with 4 additions and 30 deletions

View File

@@ -1484,15 +1484,10 @@ array_reverse(JSContext *cx, uintN argc, Value *vp)
uint32 lo = 0, hi = len - 1;
for (; lo < hi; lo++, hi--) {
Value origlo = obj->getDenseArrayElement(lo);
Value orighi = obj->getDenseArrayElement(hi);
obj->setDenseArrayElement(lo, orighi);
if (orighi.isMagic(JS_ARRAY_HOLE))
js_SuppressDeletedProperty(cx, obj, INT_TO_JSID(lo));
obj->setDenseArrayElement(hi, origlo);
if (origlo.isMagic(JS_ARRAY_HOLE))
js_SuppressDeletedProperty(cx, obj, INT_TO_JSID(hi));
}
Value tmp = obj->getDenseArrayElement(lo);
obj->setDenseArrayElement(lo, obj->getDenseArrayElement(hi));
obj->setDenseArrayElement(hi, tmp);
}
/*
* Per ECMA-262, don't update the length of the array, even if the new
@@ -2161,8 +2156,6 @@ array_shift(JSContext *cx, uintN argc, Value *vp)
memmove(elems, elems + 1, length * sizeof(jsval));
obj->setDenseArrayElement(length, MagicValue(JS_ARRAY_HOLE));
obj->setArrayLength(length);
if (!js_SuppressDeletedProperty(cx, obj, INT_TO_JSID(length)));
return JS_FALSE;
return JS_TRUE;
}