getCanonicalLocales-overridden-push.js (561B)
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 overriden Array.push. 7 8 Array.prototype.push = () => { 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);