[INFER] Update initialized length in array_pop_dense, bug 651451. r=bhackett

This commit is contained in:
Jan de Mooij 2011-04-20 18:10:59 +02:00
parent 91f31cd887
commit 0439e24a54
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,4 @@
var arr = [2];
arr.pop();
arr[0] = 2;
assertEq(arr.length, 1);

View File

@ -2353,6 +2353,8 @@ array_pop_dense(JSContext *cx, JSObject* obj, Value *vp)
if (!hole && DeleteArrayElement(cx, obj, index, true) < 0)
return JS_FALSE;
if (cx->typeInferenceEnabled())
obj->setDenseArrayInitializedLength(index);
obj->setDenseArrayLength(index);
return JS_TRUE;
}