mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 614915: set return value correctly when sorting a list containing only undefined values, r=cdleary
This commit is contained in:
parent
dcc8dc67e2
commit
bf0a0f2c33
2
js/src/jit-test/tests/basic/bug614915.js
Normal file
2
js/src/jit-test/tests/basic/bug614915.js
Normal file
@ -0,0 +1,2 @@
|
||||
var s = [undefined, undefined].sort();
|
||||
assertEq(s.length, 2);
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user