Commit f4b7ac79 authored by Chris Peterson's avatar Chris Peterson
Browse files

Bug 1366656 - XPIProvider.jsm: Replace deprecated String.localeCompare with...

Bug 1366656 - XPIProvider.jsm: Replace deprecated String.localeCompare with simple compare function. r=kmag

I see the following JavaScript warning in stdout when I run Firefox tests from the console.

JavaScript warning: resource://gre/modules/addons/XPIProvider.jsm, line 2970: String.localeCompare is deprecated; use String.prototype.localeCompare instead

MozReview-Commit-ID: ERiTd3rQ4Wc

--HG--
extra : rebase_source : a8bf8daa18842b13ca263ec6292a1c215bc19a6d
parent a62f1631
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2973,9 +2973,16 @@ this.XPIProvider = {
   *   object, which is the same as the add-ons ID.
   */
  sortBootstrappedAddons() {
    function compare(a, b) {
      if (a === b) {
        return 0;
      }
      return (a < b) ? -1 : 1;
    }

    // Sort the list so that ordering is deterministic.
    let list = Array.from(XPIStates.bootstrappedAddons());
    list.sort((a, b) => String.localeCompare(a.id, b.id));
    list.sort((a, b) => compare(a.id, b.id));

    let addons = {};
    for (let entry of list) {