• fpizlo@apple.com's avatar
    Address a FIXME in JSArray::sort · b5e07304
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=98080
    <rdar://problem/12407844>
    
    Reviewed by Oliver Hunt.
    
    Source/JavaScriptCore: 
    
    Get rid of fast sorting of sparse maps. I don't know that it's broken but I do know that we don't
    have coverage for it. Then also address the FIXME in JSArray::sort regarding side-effecting
    compare functions.
    
    * runtime/ArrayPrototype.cpp:
    (JSC::arrayProtoFuncSort):
    * runtime/JSArray.cpp:
    (JSC::JSArray::sortNumeric):
    (JSC::JSArray::sort):
    (JSC::JSArray::compactForSorting):
    * runtime/JSArray.h:
    (JSArray):
    * runtime/JSObject.h:
    (JSC::JSObject::hasSparseMap):
    (JSObject):
    
    LayoutTests: 
    
    * fast/js/jsc-test-list:
    * fast/js/script-tests/sort-with-side-effecting-comparisons.js: Added.
    * fast/js/sort-with-side-effecting-comparisons-expected.txt: Added.
    * fast/js/sort-with-side-effecting-comparisons.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b5e07304
sort-with-side-effecting-comparisons-expected.txt 249 Bytes