summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/getCanonicalLocales-overridden-set.js
blob: 396f3a94839f96aa49e6dfeca480a8cd3fe280b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// Tests the getCanonicalLocales function for overridden set().

Object.defineProperty(Array.prototype, 0, { set() { throw 42; } });

// must not throw 42, might if push is used
var arr = Intl.getCanonicalLocales(["en-US"]);

assertEqArray(arr, ["en-US"]);

if (typeof reportCompare === 'function')
    reportCompare(0, 0);