tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

getCanonicalLocales-overridden-set.js (581B)


      1 // |reftest| skip-if(!this.hasOwnProperty("Intl"))
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 // Tests the getCanonicalLocales function for overridden set().
      7 
      8 Object.defineProperty(Array.prototype, 0, { set() { throw 42; } });
      9 
     10 // must not throw 42, might if push is used
     11 var arr = Intl.getCanonicalLocales(["en-US"]);
     12 
     13 assertEqArray(arr, ["en-US"]);
     14 
     15 if (typeof reportCompare === 'function')
     16    reportCompare(0, 0);