Bug 614070 - Fix Array.prototype.unshift to always set the new length on this. r=jwalden
This commit is contained in:
@@ -2222,9 +2222,9 @@ array_unshift(JSContext *cx, uintN argc, Value *vp)
|
||||
return JS_FALSE;
|
||||
|
||||
newlen += argc;
|
||||
if (!js_SetLengthProperty(cx, obj, newlen))
|
||||
return JS_FALSE;
|
||||
}
|
||||
if (!js_SetLengthProperty(cx, obj, newlen))
|
||||
return JS_FALSE;
|
||||
|
||||
/* Follow Perl by returning the new array length. */
|
||||
vp->setNumber(newlen);
|
||||
|
||||
Reference in New Issue
Block a user