Bug 1870246 - Part 1: Update test262. r=spidermonkey-reviewers,mgaudet
[gecko.git] / js / src / tests / test262 / intl402 / Locale / constructor-options-firstDayOfWeek-invalid.js
blob5d03d0755cbb93f1d7840686c5be9cd1168d4545
1 // |reftest| skip -- Intl.Locale-info is not supported
2 // Copyright 2023 Google Inc.  All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-intl.locale
7 description: >
8     Checks error cases for the options argument to the Locale constructor.
9 info: |
10     Intl.Locale( tag [, options] )
12     ...
13     x. Let numberingSystem be ? GetOption(options, "firstDayOfWeek", "string", < *"mon"*, *"tue"*, *"wed"*, *"thu"*, *"fri"*, *"sat"*, *"sun"*, *"0"*, *"1"*, *"2"*, *"3"*, *"4"*, *"5"*, *"6"*, *"7"*> , undefined).
14     ...
16 features: [Intl.Locale,Intl.Locale-info]
17 ---*/
19 const invalidFirstDayOfWeekOptions = [
20   "",
21   "m",
22   "mo",
23   "monday",
24   true,
25   false,
26   null,
28 for (const firstDayOfWeek of invalidFirstDayOfWeekOptions) {
29   assert.throws(RangeError, function() {
30     new Intl.Locale('en', {firstDayOfWeek});
31   }, `new Intl.Locale("en", {firstDayOfWeek: "${firstDayOfWeek}"}) throws RangeError`);
34 reportCompare(0, 0);