Bug 614915: set return value correctly when sorting a list containing only undefined values, r=cdleary

This commit is contained in:
David Mandelin
2010-11-30 10:25:07 -08:00
parent 8e71fc70f5
commit cd2a6d6f5f
2 changed files with 5 additions and 1 deletions

View File

@@ -1843,8 +1843,10 @@ js::array_sort(JSContext *cx, uintN argc, Value *vp)
++newlen;
}
if (newlen == 0)
if (newlen == 0) {
vp->setObject(*obj);
return true; /* The array has only holes and undefs. */
}
/*
* The first newlen elements of vec are copied from the array object