[INFER] Fixes for botched merge.

This commit is contained in:
Brian Hackett
2010-12-20 12:10:57 -08:00
parent c86a0d636a
commit e4b5d90dd3
3 changed files with 10 additions and 4 deletions

View File

@@ -3475,10 +3475,13 @@ NewDenseCopiedArray(JSContext *cx, uintN length, Value *vp, JSObject *proto)
JSObject* obj = NewArray<true>(cx, length, proto);
JS_ASSERT(obj->getDenseArrayCapacity() >= length);
if (vp)
if (vp) {
memcpy(obj->getDenseArrayElements(), vp, length * sizeof(Value));
obj->setDenseArrayInitializedLength(length);
} else {
obj->setDenseArrayInitializedLength(0);
}
obj->setDenseArrayInitializedLength(length);
return obj;
}