Correctly sort (program) scripts in the Scripts panel popup menu.

        Reviewed by Ada Chan.

        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu): Refactor the code
        and sort "(program)" options by the sourceID to maintain some order.
        * inspector/front-end/utilities.js:
        (indexOfObjectInListSortedByFunction): Fix a bug where identical objects would cause
        an incorrect return value that confuses insertionIndexForObjectInListSortedByFunction.
        Just set 'first' and break so the correct result will be returned.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3 files changed