<rdar://problem/5908520> REGRESSION (3.1.1-r33033): Crash in WebKit when opening or
refreshing page on people.com
The problem was that STL algorithms do not work with non-conformant comparators, and the
site used sort(function() { return 0.5 - Math.random(); } to randomly shuffle an array.
kjs/array_instance.h: increaseVectorLength() now returns a bool to indicate whether it was
successful.
wtf/Vector.h:
(WTF::Vector::Vector):
(WTF::::operator=):
(WTF::::fill):
Make these methods fail instead instead of crash when allocation fails, matching resize() and
reserveCapacity(), which already had this behavior. Callers need to check for null buffer
after making any Vector call that can try to allocate.
tests/mozilla/ecma/Array/15.4.4.5-3.js: Fixed the test to use a consistent sort function,
as suggested in comments to a Mozilla bug filed about it (I'll keep tracking the bug to see
what the final resolution is).