Bug 1206265 - Add missing increment operations, r=jandem.

This commit is contained in:
Brian Hackett 2015-09-19 12:44:39 -06:00
parent 0a8a1d6c52
commit 191e9699ef
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,8 @@
x = [
objectEmulatingUndefined(),
function() {}
];
x.forEach(function() {});
this.x.sort(function() {});
assertEq(x[0] instanceof Function, false);
assertEq(x[1] instanceof Function, true);

View File

@ -502,10 +502,10 @@ SetOrExtendBoxedOrUnboxedDenseElements(ExclusiveContext* cx, JSObject* obj,
// that were left alone.
size_t i = 0;
if (updateTypes == ShouldUpdateTypes::DontUpdate) {
for (size_t j = start; i < count && j < oldInitlen; i++)
for (size_t j = start; i < count && j < oldInitlen; i++, j++)
nobj->setElementNoTypeChangeSpecific<Type>(j, vp[i]);
} else {
for (size_t j = start; i < count && j < oldInitlen; i++) {
for (size_t j = start; i < count && j < oldInitlen; i++, j++) {
if (!nobj->setElementSpecific<Type>(cx, j, vp[i]))
return DenseElementResult::Incomplete;
}