summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/DurationFormat
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/DurationFormat')
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-locales-invalid.js20
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-locales-valid.js37
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-defaults.js36
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-invalid.js26
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-valid.js28
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-invalid.js19
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-invalid.js33
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-valid.js18
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-invalid.js39
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-valid.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-order.js44
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-style-conflict.js46
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-style-invalid.js40
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/constructor-options-style-valid.js34
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/extensibility.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/length.js36
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/name.js32
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/newtarget-undefined.js30
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prop-desc.js35
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype.js23
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/constructor/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/constructor/prop-desc.js35
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/constructor/shell.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/constructor/value.js15
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/branding.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-arguments-throws.js31
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/length.js37
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/name.js29
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js36
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js38
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js38
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js38
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js38
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/not-a-constructor.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js44
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js96
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/prop-desc.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/shell.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js31
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js34
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js71
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js50
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js33
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js33
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js33
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/branding.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-default-en.js47
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-digital-en.js49
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-long-en.js49
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-narrow-en.js49
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-short-en.js49
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-arguments-throws.js40
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-negative-duration-throws.js23
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/length.js39
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/name.js29
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js50
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js52
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js52
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js52
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js52
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/not-a-constructor.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/prop-desc.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/shell.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/prototype_attributes.js21
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/length.js39
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/name.js29
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/shell.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/shell.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/shell.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toString.js20
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toStringTag.js28
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/shell.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/basic.js22
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/branding.js35
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/browser.js0
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/length.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-empty.js22
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-invalid.js23
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-specific.js25
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/name.js24
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/prop-desc.js32
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/shell.js0
93 files changed, 2678 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/DurationFormat/browser.js b/js/src/tests/test262/intl402/DurationFormat/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-locales-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-locales-invalid.js
new file mode 100644
index 0000000000..687ae01c37
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-locales-invalid.js
@@ -0,0 +1,20 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks error cases for the locales argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 3. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+for (const [locales, expectedError] of getInvalidLocaleArguments()) {
+ assert.throws(expectedError, function() { new Intl.DurationFormat(locales) })
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-locales-valid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-locales-valid.js
new file mode 100644
index 0000000000..6d58367d43
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-locales-valid.js
@@ -0,0 +1,37 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks cases for the locales argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 3. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
+features: [Intl.DurationFormat]
+---*/
+
+const defaultLocale = new Intl.DurationFormat().resolvedOptions().locale;
+
+const matchers = ["lookup", "best fit"]
+
+const tests = [
+ [undefined, defaultLocale, "undefined"],
+ ["EN", "en", "Single value"],
+ [[], defaultLocale, "Empty array"],
+ [["en", "EN"], "en", "Duplicate value (canonical first)"],
+ [["EN", "en"], "en", "Duplicate value (canonical last)"],
+ [{ 0: "DE", length: 0 }, defaultLocale, "Object with zero length"],
+ [{ 0: "DE", length: 1 }, "de", "Object with length"],
+];
+
+
+for (const [locales, expected, name] of tests) {
+ matchers.forEach((matcher)=>{
+ const drf = new Intl.DurationFormat(locales, {localeMatcher: matcher});
+ assert.sameValue(drf.resolvedOptions().locale, expected, name);
+ });
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-defaults.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-defaults.js
new file mode 100644
index 0000000000..90c8c62a28
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-defaults.js
@@ -0,0 +1,36 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks handling of valid options for the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 17. For each row in Table 1, except the header row, in table order, do
+ a. Let styleSlot be the Style Slot value.
+ b. Let displaySlot be the Display Slot value.
+ c. Let unit be the Unit value.
+ d. Let valueList be the Values value.
+ e. Let digitalBase be the Digital Default value.
+ f. Let unitOptions be ? GetUnitOptions(unit, options, style, valueList, digitalBase, prevStyle).
+ g. Set durationFormat.[[<styleSlot>]] to unitOptions.[[Style]].
+ h. Set durationFormat.[[<displaySlot>]] to unitOptions.[[Display]].
+features: [Intl.DurationFormat]
+includes: [testIntl.js]
+---*/
+
+testOption( Intl.DurationFormat, "years", "string", ["long", "short", "narrow"], "short");
+testOption( Intl.DurationFormat, "months", "string", ["long", "short", "narrow"], "short");
+testOption( Intl.DurationFormat, "weeks", "string", ["long", "short", "narrow"], "short");
+testOption( Intl.DurationFormat, "days", "string", ["long", "short", "narrow"], "short");
+testOption( Intl.DurationFormat, "hours", "string", ["long", "short", "narrow", "numeric", "2-digit"], "short");
+testOption( Intl.DurationFormat, "minutes", "string", ["long", "short", "narrow", "numeric", "2-digit"], "short");
+testOption( Intl.DurationFormat, "seconds", "string", ["long", "short", "narrow", "numeric", "2-digit"], "short");
+testOption( Intl.DurationFormat, "milliseconds", "string", ["long", "short", "narrow", "numeric"], "short");
+testOption( Intl.DurationFormat, "microseconds", "string", ["long", "short", "narrow", "numeric"], "short");
+testOption( Intl.DurationFormat, "nanoseconds", "string", ["long", "short", "narrow", "numeric"], "short");
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-invalid.js
new file mode 100644
index 0000000000..7f580a8e32
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-invalid.js
@@ -0,0 +1,26 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Tests that the option localeMatcher is processed correctly.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 18. Set durationFormat.[[FractionalDigits]] to ? GetNumberOption(options, "fractionalDigits", 0, 9, undefined).
+features: [Intl.DurationFormat]
+---*/
+
+const invalidOptions = [
+ -10,
+ 10
+];
+
+for (const fractionalDigits of invalidOptions) {
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat("en", { fractionalDigits });
+ }, `new Intl.DurationFormat("en", {fractionalDigits: "${fractionalDigits}"}) throws RangeError`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-valid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-valid.js
new file mode 100644
index 0000000000..183ebdafed
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-fractionalDigits-valid.js
@@ -0,0 +1,28 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Tests that the option localeMatcher is processed correctly.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 18. Set durationFormat.[[FractionalDigits]] to ? GetNumberOption(options, "fractionalDigits", 0, 9, undefined).
+features: [Intl.DurationFormat]
+---*/
+
+const validOptions = [
+ 0,
+ 1,
+ 5,
+ 9,
+ undefined
+];
+
+for (const fractionalDigits of validOptions) {
+ const obj = new Intl.DurationFormat("en", {fractionalDigits});
+ assert.sameValue(obj.resolvedOptions().fractionalDigits, fractionalDigits, `${fractionalDigits} is supported by DurationFormat`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-invalid.js
new file mode 100644
index 0000000000..26b0c361fa
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-invalid.js
@@ -0,0 +1,19 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks handling of a null options argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 4. Let options be GetOptionsObject(options).
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat, "function");
+
+assert.throws(TypeError, function() { new Intl.DurationFormat([], null) })
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-invalid.js
new file mode 100644
index 0000000000..ed89c0787f
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-invalid.js
@@ -0,0 +1,33 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks handling of invalid value for the localeMatcher option to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 5. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
+features: [Intl.DurationFormat]
+---*/
+
+const invalidOptions = [
+ null,
+ 1,
+ "",
+ "Lookup",
+ "LOOKUP",
+ "lookup\0",
+ "Best fit",
+ "BEST FIT",
+ "best\u00a0fit",
+];
+
+for (const localeMatcher of invalidOptions) {
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat([], { localeMatcher });
+ }, `${localeMatcher} is an invalid localeMatcher option value`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-valid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-valid.js
new file mode 100644
index 0000000000..0190aabe73
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-localeMatcher-valid.js
@@ -0,0 +1,18 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Tests that the option localeMatcher is processed correctly.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 5. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
+features: [Intl.DurationFormat]
+includes: [testIntl.js]
+---*/
+
+testOption(Intl.DurationFormat, "localeMatcher", "string", ["lookup", "best fit"], "best fit", {noReturn: true});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-invalid.js
new file mode 100644
index 0000000000..eac66df308
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-invalid.js
@@ -0,0 +1,39 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: >
+ Checks error cases for the options argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 6. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined).
+ 7. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+const invalidOptions = [
+ "",
+ "a",
+ "ab",
+ "abcdefghi",
+ "abc-abcdefghi",
+ "!invalid!",
+ "-latn-",
+ "latn-",
+ "latn--",
+ "latn-ca",
+ "latn-ca-",
+ "latn-ca-gregory",
+ "latné",
+ "latn编号",
+];
+for (const numberingSystem of invalidOptions) {
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat('en', {numberingSystem});
+ }, `new Intl.DurationFormat("en", {numberingSystem: "${numberingSystem}"}) throws RangeError`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-valid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-valid.js
new file mode 100644
index 0000000000..c053bba51a
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-numberingSystem-valid.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: >
+ Checks error cases for the options argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 6. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined).
+ 7. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+const numberingSystems = Intl.supportedValuesOf("numberingSystem");
+
+for (const numberingSystem of numberingSystems) {
+ const obj = new Intl.DurationFormat("en", {numberingSystem});
+ assert.sameValue(obj.resolvedOptions().numberingSystem, numberingSystem, `${numberingSystem} is supported by DurationFormat`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-order.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-order.js
new file mode 100644
index 0000000000..073a62fb5c
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-order.js
@@ -0,0 +1,44 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks the order of operations on the options argument to the DurationFormat constructor.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+ (...)
+ 5. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
+ 6. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined).
+ 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "long").
+includes: [compareArray.js]
+features: [Intl.DurationFormat]
+---*/
+
+var actual = [];
+
+const options = {
+ get localeMatcher() {
+ actual.push("localeMatcher");
+ return undefined;
+ },
+ get numberingSystem() {
+ actual.push("numberingSystem");
+ return undefined;
+ },
+ get style() {
+ actual.push("style");
+ return undefined;
+ },
+};
+
+const expected = [
+ "localeMatcher",
+ "numberingSystem",
+ "style"
+];
+
+let nf = new Intl.DurationFormat(undefined, options);
+assert.compareArray(actual, expected);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-conflict.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-conflict.js
new file mode 100644
index 0000000000..4ad190c997
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-conflict.js
@@ -0,0 +1,46 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2023 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-isvaliddurationrecord
+description: Checks that the "long", "short", and "narrow" styles can't be used for units following a unit using the "numeric" or "2-digit" style.
+info: |
+ GetDurationUnitOptions (unit, options, baseStyle, stylesList, digitalBase, prevStyle)
+ (...)
+ 6. If prevStyle is "numeric" or "2-digit", then
+ a. If style is not "numeric" or "2-digit", then
+ i. Throw a RangeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+let invalidOptions = {};
+for (const timeUnit of ["hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]){
+ invalidOptions[timeUnit] = "numeric";
+}
+
+for (const timeUnit of ["minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]){
+ for (const invalidStyle of ["long", "short", "narrow"]){
+ invalidOptions[timeUnit] = invalidStyle;
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat([], invalidOptions);
+ }, `${invalidStyle} is an invalid style option value when following a unit with \"numeric\" style`);
+ }
+ invalidOptions[timeUnit] = "numeric";
+}
+
+for (const timeUnit of ["hours", "minutes", "seconds"]){
+ invalidOptions[timeUnit] = "2-digit";
+}
+
+for (const timeUnit of ["minutes", "seconds", "milliseconds"]){
+ for (const invalidStyle of ["long", "short", "narrow"]){
+ invalidOptions[timeUnit] = invalidStyle;
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat([], invalidOptions);
+ }, `${invalidStyle} is an invalid style option value when following a unit with \"2-digit\" style`);
+ }
+ invalidOptions[timeUnit] = "2-digit";
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-invalid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-invalid.js
new file mode 100644
index 0000000000..7b8bcced9d
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-invalid.js
@@ -0,0 +1,40 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks handling of invalid value for the style option to the DurationFormat constructor.
+info: |
+ InitializeDurationFormat (DurationFormat, locales, options)
+ (...)
+ 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "long").
+ 14. Set durationFormat.[[Style]] to style.
+features: [Intl.DurationFormat]
+---*/
+
+const invalidOptions = [
+ null,
+ 1,
+ "",
+ "Long",
+ "LONG",
+ "long\0",
+ "Short",
+ "SHORT",
+ "short\0",
+ "Narrow",
+ "NARROW",
+ "narrow\0",
+ "Digital",
+ "DIGITAL",
+ "digital\0",
+];
+
+for (const invalidOption of invalidOptions) {
+ assert.throws(RangeError, function() {
+ new Intl.DurationFormat([], {"style": invalidOption});
+ }, `${invalidOption} is an invalid style option value`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-valid.js b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-valid.js
new file mode 100644
index 0000000000..03ebfe4d2d
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/constructor-options-style-valid.js
@@ -0,0 +1,34 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Checks handling of valid values for the style option to the DurationFormat constructor.
+info: |
+ InitializeDurationFormat (DurationFormat, locales, options)
+ (...)
+ 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "short").
+ 14. Set durationFormat.[[Style]] to style.
+features: [Intl.DurationFormat]
+---*/
+
+const validOptions = [
+ [undefined, "short"],
+ ["long", "long"],
+ ["short", "short"],
+ ["narrow", "narrow"],
+ ["digital", "digital"],
+ [{ toString() { return "short"; } }, "short"],
+ [{ toString() { return "long"; } }, "long"],
+ [{ toString() { return "narrow"; } }, "narrow"],
+ [{ toString() { return "digital"; } }, "digital"],
+];
+
+for (const [validOption, expected] of validOptions) {
+ const df = new Intl.DurationFormat([], {"style": validOption});
+ const resolvedOptions = df.resolvedOptions();
+ assert.sameValue(resolvedOptions.style, expected);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/extensibility.js b/js/src/tests/test262/intl402/DurationFormat/extensibility.js
new file mode 100644
index 0000000000..f0d7dcc554
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/extensibility.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Intl.DurationFormat instance object extensibility
+info: |
+ 17 ECMAScript Standard Built-in Objects:
+
+ Unless specified otherwise, the [[Extensible]] internal slot
+ of a built-in object initially has the value true.
+
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(
+ Object.isExtensible(new Intl.DurationFormat()),
+ true,
+ "Object.isExtensible(new Intl.DurationFormat()) returns true"
+);
+
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/length.js b/js/src/tests/test262/intl402/DurationFormat/length.js
new file mode 100644
index 0000000000..f59faedd88
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/length.js
@@ -0,0 +1,36 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat
+description: >
+ Intl.DurationFormat.length is 0.
+info: |
+ Intl.DurationFormat ( [ locales [ , options ] ] )
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every built-in function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description. Optional parameters
+ (which are indicated with brackets: [ ]) or rest parameters (which
+ are shown using the form «...name») are not included in the default
+ argument count.
+ Unless otherwise specified, the length property of a built-in function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat, 'length', {
+ value: 0,
+ enumerable: false,
+ writable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/name.js b/js/src/tests/test262/intl402/DurationFormat/name.js
new file mode 100644
index 0000000000..1dd1d72c2d
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/name.js
@@ -0,0 +1,32 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: >
+ Intl.DurationFormat.name is "DurationFormat".
+info: |
+ Intl.DurationFormat ([ locales [ , options ]])
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat, 'name', {
+ value: 'DurationFormat',
+ enumerable: false,
+ writable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/newtarget-undefined.js b/js/src/tests/test262/intl402/DurationFormat/newtarget-undefined.js
new file mode 100644
index 0000000000..5cafac6772
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/newtarget-undefined.js
@@ -0,0 +1,30 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: >
+ Verifies the NewTarget check for Intl.DurationFormat.
+info: |
+ Intl.DurationFormat ([ locales [ , options ]])
+ (...)
+ 1. If NewTarget is undefined, throw a TypeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat, "function");
+
+assert.throws(TypeError, function() {
+ Intl.DurationFormat();
+});
+
+assert.throws(TypeError, function() {
+ Intl.DurationFormat("en");
+});
+
+assert.throws(TypeError, function() {
+ Intl.DurationFormat("not-valid-tag");
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/prop-desc.js
new file mode 100644
index 0000000000..4f5ad92f25
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prop-desc.js
@@ -0,0 +1,35 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat
+description: >
+ "DurationFormat" property of Intl.
+info: |
+ Intl.DurationFormat ([ locales [ , options ]])
+
+ 7 Requirements for Standard Built-in ECMAScript Objects
+
+ Unless specified otherwise in this document, the objects, functions, and constructors
+ described in this standard are subject to the generic requirements and restrictions
+ specified for standard built-in ECMAScript objects in the ECMAScript 2018 Language
+ Specification, 9th edition, clause 17, or successor.
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every other data property described in clauses 18 through 26 and in Annex B.2 has the
+ attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
+ unless otherwise specified.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl, 'DurationFormat', {
+ enumerable: false,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype.js b/js/src/tests/test262/intl402/DurationFormat/prototype.js
new file mode 100644
index 0000000000..69ba3ef085
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype.js
@@ -0,0 +1,23 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat
+description: Intl.DurationFormat instance object is created from %DurationFormatPrototype%.
+info: |
+ Intl.DurationFormat ([ locales [ , options ]])
+
+ 2. Let durationFormat be ? OrdinaryCreateFromConstructor(NewTarget, "%DurationFormatPrototype%", « [[InitializedDurationFormat]], [[Locale]], [[DataLocale]], [[NumberingSystem]], [[Style]], [[YearsStyle]], [[YearsDisplay]], [[MonthsStyle]], [[MonthsDisplay]] , [[WeeksStyle]], [[WeeksDisplay]] , [[DaysStyle]], [[DaysDisplay]] , [[HoursStyle]], [[HoursDisplay]] , [[MinutesStyle]], [[MinutesDisplay]] , [[SecondsStyle]], [[SecondsDisplay]] , [[MillisecondsStyle]], [[MillisecondsDisplay]] , [[MicrosecondsStyle]], [[MicrosecondsDisplay]] , [[NanosecondsStyle]], [[NanosecondsDisplay]], [[FractionalDigits]] »).
+
+features: [Intl.DurationFormat]
+---*/
+
+const value = new Intl.DurationFormat();
+assert.sameValue(
+ Object.getPrototypeOf(value),
+ Intl.DurationFormat.prototype,
+ "Object.getPrototypeOf(value) equals the value of Intl.DurationFormat.prototype"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/prop-desc.js
new file mode 100644
index 0000000000..f0f66bafa2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/prop-desc.js
@@ -0,0 +1,35 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat
+description: >
+ "constructor" property of Intl.DurationFormat.prototype.
+info: |
+ Intl.DurationFormat.prototype.constructor
+
+ 7 Requirements for Standard Built-in ECMAScript Objects
+
+ Unless specified otherwise in this document, the objects, functions, and constructors
+ described in this standard are subject to the generic requirements and restrictions
+ specified for standard built-in ECMAScript objects in the ECMAScript 2018 Language
+ Specification, 9th edition, clause 17, or successor.
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every other data property described in clauses 18 through 26 and in Annex B.2 has the
+ attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
+ unless otherwise specified.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype, "constructor", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/shell.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/value.js b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/value.js
new file mode 100644
index 0000000000..c984b7829e
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/constructor/value.js
@@ -0,0 +1,15 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat
+description: >
+ Tests that Intl.DurationFormat.prototype.constructor is the Intl.DurationFormat.
+
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(Intl.DurationFormat.prototype.constructor, Intl.DurationFormat, "Intl.DurationFormat.prototype.constructor is not the same as Intl.DurationFormat");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/branding.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/branding.js
new file mode 100644
index 0000000000..acaccd554b
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/branding.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Verifies the branding check for the "format" function of the DurationFormat prototype object.
+features: [Intl.DurationFormat]
+---*/
+
+const format = Intl.DurationFormat.prototype.format;
+
+assert.sameValue(typeof format, "function");
+
+assert.throws(TypeError, () => format.call(undefined, { years : 2 }), "undefined");
+assert.throws(TypeError, () => format.call(null, { years : 2 }), "null");
+assert.throws(TypeError, () => format.call(true, { years : 2 }), "true");
+assert.throws(TypeError, () => format.call("", { years : 2 }), "empty string");
+assert.throws(TypeError, () => format.call(Symbol(), { years : 2 }), "symbol");
+assert.throws(TypeError, () => format.call(1, { years : 2 }), "1");
+assert.throws(TypeError, () => format.call({}, { years : 2 }), "plain object");
+assert.throws(TypeError, () => format.call(Intl.DurationFormat, { years : 2 } ), "Intl.DurationFormat");
+assert.throws(TypeError, () => format.call(Intl.DurationFormat.prototype, { years : 2 }), "Intl.DurationFormat.prototype");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-arguments-throws.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-arguments-throws.js
new file mode 100644
index 0000000000..ed9c268b63
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-arguments-throws.js
@@ -0,0 +1,31 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ "format" basic tests for invalid arguments that should throw TypeError exception.
+info: |
+ Intl.DurationFormat.prototype.format(duration)
+ (...)
+ 3. Let record be ? ToDurationRecord(duration)
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+assert.throws(TypeError, () => { df.format(undefined) }, "undefined" );
+assert.throws(TypeError, () => { df.format(null) }, "null");
+assert.throws(TypeError, () => { df.format(true) }, "true");
+assert.throws(TypeError, () => { df.format(-12) }, "-12");
+assert.throws(TypeError, () => { df.format(-12n) }, "-12n");
+assert.throws(TypeError, () => { df.format(1) }, "1");
+assert.throws(TypeError, () => { df.format(2n) }, "2n");
+assert.throws(TypeError, () => { df.format({}) }, "plain object");
+assert.throws(TypeError, () => { df.format({ year: 1 }) }, "unsuported property");
+assert.throws(TypeError, () => { df.format({ years: undefined }) }, "supported property set undefined");
+assert.throws(TypeError, () => { df.format(Symbol())}, "symbol");
+assert.throws(RangeError, () => { df.format("bad string")}, "bad string");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js
new file mode 100644
index 0000000000..b349ee52f7
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: format basic tests for invalid negative duration objects that should throw RangeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+
+
+const df = new Intl.DurationFormat();
+
+assert.throws(RangeError, () => { df.format({
+ hours : -1,
+ minutes: 10
+}), "Throws when mixing negative and positive values" });
+
+assert.throws(RangeError, () => { df.format({
+ hours : 2,
+ minutes: -10
+}), "Throws when mixing negative and positive values" });
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/length.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/length.js
new file mode 100644
index 0000000000..073a761a32
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/length.js
@@ -0,0 +1,37 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Intl.DurationFormat.prototype.format.length is 1.
+info: |
+ Intl.DurationFormat.prototype.format ( duration )
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every built-in function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description. Optional parameters
+ (which are indicated with brackets: [ ]) or rest parameters (which
+ are shown using the form «...name») are not included in the default
+ argument count.
+ Unless otherwise specified, the length property of a built-in function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype.format, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/name.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/name.js
new file mode 100644
index 0000000000..57a2250fd2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/name.js
@@ -0,0 +1,29 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Checks the "name" property of Intl.DurationFormat.prototype.format().
+info: |
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype.format, "name", {
+ value: "format",
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js
new file mode 100644
index 0000000000..c6b58a5dfc
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js
@@ -0,0 +1,36 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Test format method with negative duration and default style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -3,
+ hours: -4,
+ minutes: -5,
+ seconds: -6,
+ milliseconds: -7,
+ microseconds: -8,
+ nanoseconds: -9,
+};
+
+const expected = formatDurationFormatPattern(duration);
+
+const df = new Intl.DurationFormat("en");
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `DurationFormat format output using default style option`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js
new file mode 100644
index 0000000000..83eb5b4639
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js
@@ -0,0 +1,38 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Test format method with negative duration and "short" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "short";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -3,
+ hours: -4,
+ minutes: -5,
+ seconds: -6,
+ milliseconds: -7,
+ microseconds: -8,
+ nanoseconds: -9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `DurationFormat format output using ${style} style option`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js
new file mode 100644
index 0000000000..c9f119c368
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js
@@ -0,0 +1,38 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Test format method with negative duration and "digital" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "digital";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -3,
+ hours: -4,
+ minutes: -5,
+ seconds: -6,
+ milliseconds: -7,
+ microseconds: -8,
+ nanoseconds: -9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `DurationFormat format output using ${style} style option`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js
new file mode 100644
index 0000000000..fe074d488e
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js
@@ -0,0 +1,38 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Test format method with negative duration and "long" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "long";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -3,
+ hours: -4,
+ minutes: -5,
+ seconds: -6,
+ milliseconds: -7,
+ microseconds: -8,
+ nanoseconds: -9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `DurationFormat format output using ${style} style option`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js
new file mode 100644
index 0000000000..4d1db5dc67
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js
@@ -0,0 +1,38 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Test format method with negative duration and "narrow" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "narrow";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -3,
+ hours: -4,
+ minutes: -5,
+ seconds: -6,
+ milliseconds: -7,
+ microseconds: -8,
+ nanoseconds: -9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `DurationFormat format output using ${style} style option`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/not-a-constructor.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/not-a-constructor.js
new file mode 100644
index 0000000000..a029decc62
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/not-a-constructor.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ Intl.DurationFormat.prototype.format does not implement [[Construct]], is not new-able
+info: |
+ Built-in function objects that are not identified as constructors do not implement the
+ [[Construct]] internal method unless otherwise specified in the description of a particular
+ function.
+includes: [isConstructor.js]
+features: [Reflect.construct, Intl.DurationFormat]
+---*/
+
+assert.throws(TypeError, () => {
+ new Intl.DurationFormat.prototype.format();
+}, "Calling as constructor");
+
+assert.sameValue(isConstructor(Intl.DurationFormat.prototype.format), false,
+ "isConstructor(Intl.DurationFormat.prototype.format)");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js
new file mode 100644
index 0000000000..dc5ad4ea84
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js
@@ -0,0 +1,44 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ The correct separator is used for numeric hours with zero minutes and non-zero seconds.
+locale: [en-US]
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat("en", {
+ // hours must be numeric, so that a time separator is used for the following units.
+ hours: "numeric",
+});
+
+const lf = new Intl.ListFormat("en", {
+ type: "unit",
+ style: "short",
+});
+
+const duration = {
+ hours: 1,
+
+ // Minutes is omitted from the output when its value is zero.
+ minutes: 0,
+
+ // Either seconds or sub-seconds must be non-zero.
+ seconds: 3,
+};
+
+const expected = lf.format([
+ new Intl.NumberFormat("en", {minimumIntegerDigits: 1}).format(duration.hours),
+ new Intl.NumberFormat("en", {minimumIntegerDigits: 2}).format(duration.seconds),
+]);
+
+assert.sameValue(
+ df.format(duration),
+ expected,
+ `No time separator is used when minutes is zero`
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js
new file mode 100644
index 0000000000..5518450d6a
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js
@@ -0,0 +1,96 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: >
+ PartitionDurationFormatPattern computes on exact mathematical values.
+info: |
+ PartitionDurationFormatPattern ( durationFormat, duration )
+ ...
+ 4. While done is false, repeat for each row in Table 1 in order, except the header row:
+ ...
+ j. If unit is "seconds", "milliseconds", or "microseconds", then
+ i. If unit is "seconds", then
+ 1. Let nextStyle be durationFormat.[[MillisecondsStyle]].
+ ...
+ iv. If nextStyle is "numeric", then
+ 1. If unit is "seconds", then
+ a. Set value to value + duration.[[Milliseconds]] / 10^3 + duration.[[Microseconds]] / 10^6 + duration.[[Nanoseconds]] / 10^9.
+ ...
+ l. If value is not 0 or display is not "auto", then
+ ii. If style is "2-digit" or "numeric", then
+ ...
+ 7. Let parts be ! PartitionNumberPattern(nf, value).
+ ...
+
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const durations = [
+ // 10000000 + (1 / 10^9)
+ // = 10000000.000000001
+ {
+ seconds: 10_000_000,
+ nanoseconds: 1,
+ },
+
+ // 9007199254740991 + (9007199254740991 / 10^3) + (9007199254740991 / 10^6) + (9007199254740991 / 10^9)
+ // = 9.016215470202185986731991 × 10^15
+ {
+ seconds: Number.MAX_SAFE_INTEGER,
+ milliseconds: Number.MAX_SAFE_INTEGER,
+ microseconds: Number.MAX_SAFE_INTEGER,
+ nanoseconds: Number.MAX_SAFE_INTEGER,
+ },
+ {
+ seconds: Number.MIN_SAFE_INTEGER,
+ milliseconds: Number.MIN_SAFE_INTEGER,
+ microseconds: Number.MIN_SAFE_INTEGER,
+ nanoseconds: Number.MIN_SAFE_INTEGER,
+ },
+
+ // 1 + (2 / 10^3) + (3 / 10^6) + (9007199254740991 / 10^9)
+ // = 9.007200256743991 × 10^6
+ {
+ seconds: 1,
+ milliseconds: 2,
+ microseconds: 3,
+ nanoseconds: Number.MAX_SAFE_INTEGER,
+ },
+
+ // 9007199254740991 + (10^3 / 10^3) + (10^6 / 10^6) + (10^9 / 10^9)
+ // = 9007199254740991 + 3
+ // = 9007199254740994
+ {
+ seconds: Number.MAX_SAFE_INTEGER,
+ milliseconds: 10 ** 3,
+ microseconds: 10 ** 6,
+ nanoseconds: 10 ** 9,
+ },
+
+ // ~1.7976931348623157e+308 / 10^9
+ // = ~1.7976931348623157 × 10^299
+ {
+ seconds: 0,
+ milliseconds: 0,
+ microseconds: 0,
+ nanoseconds: Number.MAX_VALUE,
+ },
+];
+
+const df = new Intl.DurationFormat("en", {style: "digital"});
+
+for (let duration of durations) {
+ let expected = formatDurationFormatPattern(duration, "digital");
+ assert.sameValue(
+ df.format(duration),
+ expected,
+ `Duration is ${JSON.stringify(duration)}`
+ );
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/prop-desc.js
new file mode 100644
index 0000000000..ebb842ae83
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/prop-desc.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Property descriptor of Intl.DurationFormat.prototype.format
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(
+ typeof Intl.DurationFormat.prototype.format,
+ 'function',
+ '`typeof Intl.DurationFormat.prototype.format` is `function`'
+);
+
+verifyProperty(Intl.DurationFormat.prototype, 'format', {
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/shell.js
@@ -0,0 +1,24 @@
+// GENERATED, DO NOT EDIT
+// file: isConstructor.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: |
+ Test if a given function is a constructor function.
+defines: [isConstructor]
+features: [Reflect.construct]
+---*/
+
+function isConstructor(f) {
+ if (typeof f !== "function") {
+ throw new Test262Error("isConstructor invoked with a non-function value");
+ }
+
+ try {
+ Reflect.construct(function(){}, [], f);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js
new file mode 100644
index 0000000000..6eb5c4999e
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js
@@ -0,0 +1,31 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Test if format method formats duration correctly with different "style" arguments
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const duration = {
+ years: 1,
+ months: 2,
+ weeks: 3,
+ days: 3,
+ hours: 4,
+ minutes: 5,
+ seconds: 6,
+ milliseconds: 7,
+ microseconds: 8,
+ nanoseconds: 9,
+};
+
+const expected = formatDurationFormatPattern(duration);
+
+const df = new Intl.DurationFormat("en");
+assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using default style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js
new file mode 100644
index 0000000000..4f34d50aa9
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js
@@ -0,0 +1,34 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// Copyright 2023 Apple Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Test if format method formats duration correctly with different "style" arguments
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "digital";
+
+const duration = {
+ years: 1,
+ months: 2,
+ weeks: 3,
+ days: 3,
+ hours: 4,
+ minutes: 5,
+ seconds: 6,
+ milliseconds: 7,
+ microseconds: 8,
+ nanoseconds: 9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js
new file mode 100644
index 0000000000..631e6c36eb
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js
@@ -0,0 +1,71 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-partitiondurationformatpattern
+description: >
+ Test to ensure that correct number of fractional digits is displayed (i.e. however many are necessary to represent the data fully) if the fractionalDigits option is left *undefined*
+
+info: |
+ 4. If durationFormat.[[FractionalDigits]] is undefined, then
+ a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9).
+ b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0).
+ 5. Else,
+ a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]).
+ b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]).
+features: [Intl.DurationFormat]
+---*/
+
+
+const durationNano = {
+ hours: 1,
+ minutes: 22,
+ seconds: 33,
+ milliseconds: 111,
+ microseconds: 222,
+ nanoseconds: 333
+};
+
+const durationMicro = {
+ hours: 1,
+ minutes: 22,
+ seconds: 33,
+ milliseconds: 111,
+ microseconds: 222
+};
+
+const durationMill = {
+ hours: 1,
+ minutes: 22,
+ seconds: 33,
+ milliseconds: 111
+};
+
+const durationNoSubsecond = {
+ hours: 1,
+ minutes: 22,
+ seconds: 33
+};
+
+const durationSevenFractional = {
+ hours: 2,
+ minutes: 30,
+ seconds: 10,
+ milliseconds: 111,
+ microseconds: 220,
+ nanoseconds: 300
+};
+
+const style = "digital";
+const df = new Intl.DurationFormat(undefined, {style, fractionalDigits: undefined});
+
+assert.sameValue(df.format(durationNano), "1:22:33.111222333", `format output with nanosecond digits and fractionalDigits: undefined using ${style} style option`);
+assert.sameValue(df.format(durationMicro), "1:22:33.111222", `format output with microsecond digits and fractionalDigits: undefined using ${style} style option`);
+assert.sameValue(df.format(durationMilli), "1:22:33.111", `format output with millisecond digits and fractionalDigits: undefined using ${style} style option`);
+assert.sameValue(df.format(durationNoSubsecond), "1:22:33", `format output with no subsecond digits and fractionalDigits: undefined using ${style} style option`);
+
+assert.sameValue(df.format(durationFiveFractional), "2:30:11122", `format output with five subsecond digits and fractionalDigits: undefined using ${style} style option`);
+assert.sameValue(df.format(durationSevenFractional), "2:30:1112203", `format output with seven subsecond digits and fractionalDigits: undefined using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js
new file mode 100644
index 0000000000..d75f51b14a
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js
@@ -0,0 +1,50 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-partitiondurationformatpattern
+description: >
+ Test to ensure that correct number of fractional digits is displayed if fractionalDigits is explicitly specified.
+
+info: |
+ 4. If durationFormat.[[FractionalDigits]] is undefined, then
+ a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9).
+ b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0).
+ 5. Else,
+ a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]).
+ b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]).
+features: [Intl.DurationFormat]
+---*/
+
+const duration = {
+ hours: 1,
+ minutes: 22,
+ seconds: 33,
+ milliseconds: 111,
+ microseconds: 222,
+ nanoseconds: 333,
+};
+
+
+const style = "digital";
+const df = new Intl.DurationFormat(undefined, {style, fractionalDigits: 0});
+const dfMilli = new Intl.DurationFormat(undefined, {style, fractionalDigits: 3});
+const dfFourDigits = new Intl.DurationFormat(undefined, {style, fractionalDigits: 4});
+const dfMicro = new Intl.DurationFormat(undefined, {style, fractionalDigits: 6});
+const dfEightDigits = new Intl.DurationFormat(undefined, {style, fractionalDigits: 8});
+const dfNano = new Intl.DurationFormat(undefined, {style, fractionalDigits: 9});
+
+assert.sameValue(df.format(duration), "1:22:33", `format output without sub-second digits using ${style} style option`);
+
+assert.sameValue(dfMilli.format(duration), "1:22:33.111", `format output with sub-second digits and fractionalDigits: 3 using ${style} style option`);
+
+assert.sameValue(dfFourDigits.format(duration), "1:22:33.1112", `format output with sub-second digits and fractionalDigits: 4 using ${style} style option`);
+
+assert.sameValue(dfMicro.format(duration), "1:22:33.111222", `format output with sub-second digits and fractionalDigits: 6 using ${style} style option`);
+
+assert.sameValue(dfEightDigits.format(duration), "1:22:33.11122233", `format output with sub-second digits and fractionalDigits: 8 using ${style} style option`);
+
+assert.sameValue(dfNano.format(duration), "1:22:33.111222333", `format output with sub-second digits and fractionalDigits: 9 using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js
new file mode 100644
index 0000000000..d9e6fc6cbb
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js
@@ -0,0 +1,33 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Test if format method formats duration correctly with different "style" arguments
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "long";
+
+const duration = {
+ years: 1,
+ months: 2,
+ weeks: 3,
+ days: 3,
+ hours: 4,
+ minutes: 5,
+ seconds: 6,
+ milliseconds: 7,
+ microseconds: 8,
+ nanoseconds: 9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js
new file mode 100644
index 0000000000..66b2258761
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js
@@ -0,0 +1,33 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Test if format method formats duration correctly with different "style" arguments
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "narrow";
+
+const duration = {
+ years: 1,
+ months: 2,
+ weeks: 3,
+ days: 3,
+ hours: 4,
+ minutes: 5,
+ seconds: 6,
+ milliseconds: 7,
+ microseconds: 8,
+ nanoseconds: 9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js
new file mode 100644
index 0000000000..2a66c01b06
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js
@@ -0,0 +1,33 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.format
+description: Test if format method formats duration correctly with different "style" arguments
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+const style = "short";
+
+const duration = {
+ years: 1,
+ months: 2,
+ weeks: 3,
+ days: 3,
+ hours: 4,
+ minutes: 5,
+ seconds: 6,
+ milliseconds: 7,
+ microseconds: 8,
+ nanoseconds: 9,
+};
+
+const expected = formatDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", {style});
+assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using ${style} style option`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
new file mode 100644
index 0000000000..1e59d7c6d9
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype.format
+description: basic tests internal slot initialization and call receiver errors
+info: |
+ Intl.DurationFormat.prototype.format ( duration )
+ (...)
+ 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+let f = df["format"];
+
+assert.sameValue(typeof f, "function");
+assert.throws(TypeError, () => {
+ f({ hours: 1, minutes: 46, seconds: 40 });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/branding.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/branding.js
new file mode 100644
index 0000000000..179fdcb064
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/branding.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Verifies the branding check for the "formatToParts" function of the DurationFormat prototype object.
+features: [Intl.DurationFormat]
+---*/
+
+const formatToParts = Intl.DurationFormat.prototype.formatToParts;
+
+assert.sameValue(typeof formatToParts, "function");
+
+assert.throws(TypeError, () => formatToParts.call(undefined, { years : 2 }), "undefined");
+assert.throws(TypeError, () => formatToParts.call(null, { years : 2 }), "null");
+assert.throws(TypeError, () => formatToParts.call(true, { years : 2 }), "true");
+assert.throws(TypeError, () => formatToParts.call("", { years : 2 }), "empty string");
+assert.throws(TypeError, () => formatToParts.call(Symbol(), { years : 2 }), "symbol");
+assert.throws(TypeError, () => formatToParts.call(1, { years : 2 }), "1");
+assert.throws(TypeError, () => formatToParts.call({}, { years : 2 }), "plain object");
+assert.throws(TypeError, () => formatToParts.call(Intl.DurationFormat, { years : 2 } ), "Intl.DurationFormat");
+assert.throws(TypeError, () => formatToParts.call(Intl.DurationFormat.prototype, { years : 2 }), "Intl.DurationFormat.prototype");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-default-en.js
new file mode 100644
index 0000000000..03b16dc627
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-default-en.js
@@ -0,0 +1,47 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks basic handling of formatToParts, using long, short,narrow and digital styles.
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+// Utils functions
+function* zip(a, b) {
+ for (let i = 0; i < a.length; ++i) {
+ yield [i, a[i], b[i]];
+ }
+}
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
+ // assertions
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ if (expectedEntry.unit) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+const duration = {
+ hours: 7,
+ minutes: 8,
+ seconds: 9,
+ milliseconds: 123,
+ microseconds: 456,
+ nanoseconds: 789,
+};
+
+const expected = partitionDurationFormatPattern(duration);
+
+let df = new Intl.DurationFormat('en');
+compare(df.formatToParts(duration), expected, `Using style : default`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-digital-en.js
new file mode 100644
index 0000000000..0e8246f212
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-digital-en.js
@@ -0,0 +1,49 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks basic handling of formatToParts, using long, short,narrow and digital styles.
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+// Utils functions
+function* zip(a, b) {
+ for (let i = 0; i < a.length; ++i) {
+ yield [i, a[i], b[i]];
+ }
+}
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
+ // assertions
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ if (expectedEntry.unit) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+const duration = {
+ hours: 7,
+ minutes: 8,
+ seconds: 9,
+ milliseconds: 123,
+ microseconds: 456,
+ nanoseconds: 789,
+};
+
+const style = "digital";
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+let df = new Intl.DurationFormat('en', { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-long-en.js
new file mode 100644
index 0000000000..a54ddb61f8
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-long-en.js
@@ -0,0 +1,49 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks basic handling of formatToParts, using long, short,narrow and digital styles.
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+// Utils functions
+function* zip(a, b) {
+ for (let i = 0; i < a.length; ++i) {
+ yield [i, a[i], b[i]];
+ }
+}
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
+ // assertions
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ if (expectedEntry.unit) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+const duration = {
+ hours: 7,
+ minutes: 8,
+ seconds: 9,
+ milliseconds: 123,
+ microseconds: 456,
+ nanoseconds: 789,
+};
+
+const style = "long";
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+let df = new Intl.DurationFormat('en', { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-narrow-en.js
new file mode 100644
index 0000000000..feff8fda60
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-narrow-en.js
@@ -0,0 +1,49 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks basic handling of formatToParts, using long, short,narrow and digital styles.
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+// Utils functions
+function* zip(a, b) {
+ for (let i = 0; i < a.length; ++i) {
+ yield [i, a[i], b[i]];
+ }
+}
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
+ // assertions
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ if (expectedEntry.unit) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+const duration = {
+ hours: 7,
+ minutes: 8,
+ seconds: 9,
+ milliseconds: 123,
+ microseconds: 456,
+ nanoseconds: 789,
+};
+
+const style = "narrow";
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+let df = new Intl.DurationFormat('en', { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-short-en.js
new file mode 100644
index 0000000000..605448bde0
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/formatToParts-style-short-en.js
@@ -0,0 +1,49 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks basic handling of formatToParts, using long, short,narrow and digital styles.
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+// Utils functions
+function* zip(a, b) {
+ for (let i = 0; i < a.length; ++i) {
+ yield [i, a[i], b[i]];
+ }
+}
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
+ // assertions
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ if (expectedEntry.unit) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+const duration = {
+ hours: 7,
+ minutes: 8,
+ seconds: 9,
+ milliseconds: 123,
+ microseconds: 456,
+ nanoseconds: 789,
+};
+
+const style = "short";
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+let df = new Intl.DurationFormat('en', { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-arguments-throws.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-arguments-throws.js
new file mode 100644
index 0000000000..7f3105086f
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-arguments-throws.js
@@ -0,0 +1,40 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ "formatToParts" basic tests for invalid arguments that should throw TypeError exception.
+info: |
+ Intl.DurationFormat.prototype.formatToParts(duration)
+ (...)
+ 3. Let record be ? ToDurationRecord(duration)
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+const testOptions = [ "years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"];
+
+assert.throws(TypeError, () => { df.formatToParts(undefined) }, "undefined" );
+assert.throws(TypeError, () => { df.formatToParts(null) }, "null");
+assert.throws(TypeError, () => { df.formatToParts(true) }, "true");
+assert.throws(TypeError, () => { df.formatToParts(-12) }, "-12");
+assert.throws(TypeError, () => { df.formatToParts(-12n) }, "-12n");
+assert.throws(TypeError, () => { df.formatToParts(1) }, "1");
+assert.throws(TypeError, () => { df.formatToParts(2n) }, "2n");
+assert.throws(TypeError, () => { df.formatToParts({}) }, "plain object");
+assert.throws(TypeError, () => { df.formatToParts({ year: 1 }) }, "unsuported property");
+assert.throws(TypeError, () => { df.formatToParts({ years: undefined }) }, "supported property set undefined");
+assert.throws(TypeError, () => { df.formatToParts(Symbol())}, "symbol");
+assert.throws(RangeError, () => { df.formatToParts("bad string")}, "bad string");
+
+testOptions.forEach( option => {
+ assert.throws(RangeError, () => { df.formatToParts({ [option]: 2.5 })}, " duration properties must be integers");
+});
+
+testOptions.forEach( option => {
+ assert.throws(RangeError, () => { df.formatToParts({ [option]: -Infinity })}, " duration properties must be integers");
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-negative-duration-throws.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-negative-duration-throws.js
new file mode 100644
index 0000000000..ede7dd8839
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/invalid-negative-duration-throws.js
@@ -0,0 +1,23 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: formatToParts basic tests for invalid negative duration objects that should throw RangeError exception.
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+assert.throws(RangeError, () => { df.formatToParts({
+ hours : -1,
+ minutes: 10
+}), "Throws when mixing negative and positive values" });
+
+assert.throws(RangeError, () => { df.formatToParts({
+ hours : 2,
+ minutes: -10
+}), "Throws when mixing negative and positive values" });
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/length.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/length.js
new file mode 100644
index 0000000000..c131c7e239
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/length.js
@@ -0,0 +1,39 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.datetimeformat.prototype.formatToParts
+description: >
+ Intl.DateTimeFormat.prototype.formatToParts.length is 1.
+info: |
+ Intl.DateTimeFormat.prototype.formatToParts ( date )
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every built-in function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description. Optional parameters
+ (which are indicated with brackets: [ ]) or rest parameters (which
+ are shown using the form «...name») are not included in the default
+ argument count.
+ Unless otherwise specified, the length property of a built-in function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Intl.DateTimeFormat.prototype.formatToParts.length, 1);
+
+verifyProperty(Intl.DurationFormat.prototype.formatToParts, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/name.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/name.js
new file mode 100644
index 0000000000..dc21910462
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/name.js
@@ -0,0 +1,29 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Checks the "name" property of Intl.DurationFormat.prototype.formatToParts().
+info: |
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype.formatToParts, "name", {
+ value: "formatToParts",
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js
new file mode 100644
index 0000000000..bfc182c34b
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js
@@ -0,0 +1,50 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Test formatToParts method with negative duration and default style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (let i = 0; i < expected.length; ++i) {
+ let actualEntry = actual[i];
+ let expectedEntry = expected[i];
+
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ assert.sameValue("unit" in actualEntry, "unit" in expectedEntry, `unit for entry ${i}`);
+ if ("unit" in expectedEntry) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -4,
+ hours: -5,
+ minutes: -6,
+ seconds: -7,
+ milliseconds: -123,
+ microseconds: -456,
+ nanoseconds: -789,
+};
+
+const expected = partitionDurationFormatPattern(duration);
+
+const df = new Intl.DurationFormat("en");
+compare(df.formatToParts(duration), expected, `Using style : default`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js
new file mode 100644
index 0000000000..52a40072ba
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js
@@ -0,0 +1,52 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Test formatToParts method with negative duration and "digital" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (let i = 0; i < expected.length; ++i) {
+ let actualEntry = actual[i];
+ let expectedEntry = expected[i];
+
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ assert.sameValue("unit" in actualEntry, "unit" in expectedEntry, `unit for entry ${i}`);
+ if ("unit" in expectedEntry) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+
+const style = "digital";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -4,
+ hours: -5,
+ minutes: -6,
+ seconds: -7,
+ milliseconds: -123,
+ microseconds: -456,
+ nanoseconds: -789,
+};
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js
new file mode 100644
index 0000000000..3756db8a84
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js
@@ -0,0 +1,52 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Test formatToParts method with negative duration and "long" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (let i = 0; i < expected.length; ++i) {
+ let actualEntry = actual[i];
+ let expectedEntry = expected[i];
+
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ assert.sameValue("unit" in actualEntry, "unit" in expectedEntry, `unit for entry ${i}`);
+ if ("unit" in expectedEntry) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+
+const style = "long";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -4,
+ hours: -5,
+ minutes: -6,
+ seconds: -7,
+ milliseconds: -123,
+ microseconds: -456,
+ nanoseconds: -789,
+};
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js
new file mode 100644
index 0000000000..a9717ce67a
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js
@@ -0,0 +1,52 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Test formatToParts method with negative duration and "narrow" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (let i = 0; i < expected.length; ++i) {
+ let actualEntry = actual[i];
+ let expectedEntry = expected[i];
+
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ assert.sameValue("unit" in actualEntry, "unit" in expectedEntry, `unit for entry ${i}`);
+ if ("unit" in expectedEntry) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+
+const style = "narrow";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -4,
+ hours: -5,
+ minutes: -6,
+ seconds: -7,
+ milliseconds: -123,
+ microseconds: -456,
+ nanoseconds: -789,
+};
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js
new file mode 100644
index 0000000000..bc2ed69c5b
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js
@@ -0,0 +1,52 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2023 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Test formatToParts method with negative duration and "short" style
+locale: [en-US]
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+function compare(actual, expected, message) {
+ assert.sameValue(Array.isArray(expected), true, `${message}: expected is Array`);
+ assert.sameValue(Array.isArray(actual), true, `${message}: actual is Array`);
+ assert.sameValue(actual.length, expected.length, `${message}: length`);
+
+ for (let i = 0; i < expected.length; ++i) {
+ let actualEntry = actual[i];
+ let expectedEntry = expected[i];
+
+ assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
+ assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
+ assert.sameValue("unit" in actualEntry, "unit" in expectedEntry, `unit for entry ${i}`);
+ if ("unit" in expectedEntry) {
+ assert.sameValue(actualEntry.unit, expectedEntry.unit, `unit for entry ${i}`);
+ }
+ }
+}
+
+const style = "short";
+
+const duration = {
+ years: -1,
+ months: -2,
+ weeks: -3,
+ days: -4,
+ hours: -5,
+ minutes: -6,
+ seconds: -7,
+ milliseconds: -123,
+ microseconds: -456,
+ nanoseconds: -789,
+};
+
+const expected = partitionDurationFormatPattern(duration, style);
+
+const df = new Intl.DurationFormat("en", { style });
+compare(df.formatToParts(duration), expected, `Using style : ${style}`);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/not-a-constructor.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/not-a-constructor.js
new file mode 100644
index 0000000000..b845cabe35
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/not-a-constructor.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: >
+ Intl.DurationFormat.prototype.formatToParts does not implement [[Construct]], is not new-able
+info: |
+ Built-in function objects that are not identified as constructors do not implement the
+ [[Construct]] internal method unless otherwise specified in the description of a particular
+ function.
+includes: [isConstructor.js]
+features: [Reflect.construct, Intl.DurationFormat]
+---*/
+
+assert.throws(TypeError, () => {
+ new Intl.DurationFormat.prototype.formatToParts();
+}, "Calling as constructor");
+
+assert.sameValue(isConstructor(Intl.DurationFormat.prototype.formatToParts), false,
+ "isConstructor(Intl.DurationFormat.prototype.formatToParts)");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/prop-desc.js
new file mode 100644
index 0000000000..3c32931386
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/prop-desc.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.formatToParts
+description: Property descriptor of Intl.DurationFormat.prototype.formatToParts
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(
+ typeof Intl.DurationFormat.prototype.formatToParts,
+ 'function',
+ '`typeof Intl.DurationFormat.prototype.formatToParts` is `function`'
+);
+
+verifyProperty(Intl.DurationFormat.prototype, 'formatToParts', {
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/shell.js
@@ -0,0 +1,24 @@
+// GENERATED, DO NOT EDIT
+// file: isConstructor.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: |
+ Test if a given function is a constructor function.
+defines: [isConstructor]
+features: [Reflect.construct]
+---*/
+
+function isConstructor(f) {
+ if (typeof f !== "function") {
+ throw new Test262Error("isConstructor invoked with a non-function value");
+ }
+
+ try {
+ Reflect.construct(function(){}, [], f);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js
new file mode 100644
index 0000000000..d091b49dd2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype.format
+description: basic tests internal slot initialization and call receiver errors
+info: |
+ Intl.DurationFormat.prototype.formatToParts ( duration )
+ (...)
+ 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+let f = df["formatToParts"];
+
+assert.sameValue(typeof f, "function");
+assert.throws(TypeError, () => {
+ f({ hours: 1, minutes: 46, seconds: 40 });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/prototype_attributes.js b/js/src/tests/test262/intl402/DurationFormat/prototype/prototype_attributes.js
new file mode 100644
index 0000000000..34e2511dda
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/prototype_attributes.js
@@ -0,0 +1,21 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype
+description: Prototype attributes verification
+info: |
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat, "prototype", {
+ value: Intl.DurationFormat.prototype,
+ writable: false,
+ enumerable: false,
+ configurable: false,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/length.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/length.js
new file mode 100644
index 0000000000..f59ec0500f
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/length.js
@@ -0,0 +1,39 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype.resolvedoptions
+description: >
+ Intl.DurationFormat.prototype.resolvedOptions.length is 0.
+info: |
+ Intl.DurationFormat.prototype.resolvedOptions ()
+
+ 17 ECMAScript Standard Built-in Objects:
+
+ Every built-in function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description. Optional parameters
+ (which are indicated with brackets: [ ]) or rest parameters (which
+ are shown using the form «...name») are not included in the default
+ argument count.
+ Unless otherwise specified, the length property of a built-in function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+
+features: [Intl.DurationFormat]
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Intl.DurationFormat.prototype.resolvedOptions.length, 0);
+
+verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "length", {
+ value: 0,
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/name.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/name.js
new file mode 100644
index 0000000000..dbab5aaa2b
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/name.js
@@ -0,0 +1,29 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.resolvedOptions
+description: Checks the "name" property of Intl.DurationFormat.prototype.resolvedOptions().
+info: |
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "name", {
+ value: "resolvedOptions",
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js
new file mode 100644
index 0000000000..1b667908c4
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.prototype.resolvedOptions
+description: Property descriptor of Intl.DurationFormat.prototype.resolvedOptions
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(
+ typeof Intl.DurationFormat.prototype.resolvedOptions,
+ 'function',
+ '`typeof Intl.DurationFormat.prototype.resolvedOptions` is `function`'
+);
+
+verifyProperty(Intl.DurationFormat.prototype, 'resolvedOptions', {
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/shell.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js
new file mode 100644
index 0000000000..a75c9f2bb4
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype.resolvedOptions
+description: basic tests internal slot initialization and call receiver errors
+info: |
+ Intl.DurationFormat.prototype.resolvedOptions ( )
+ (...)
+ 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+let f = df['resolvedOptions'];
+
+assert.sameValue(typeof f, 'function');
+assert.throws(TypeError, () => { f() });
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/shell.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/browser.js b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/shell.js b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/shell.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toString.js b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toString.js
new file mode 100644
index 0000000000..b02fe53967
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toString.js
@@ -0,0 +1,20 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype-@@tostringtag
+description: >
+ Object.prototype.toString utilizes Intl.DurationFormat.prototype[@@toStringTag].
+info: |
+ Intl.DurationFormat.prototype [ @@toStringTag ]
+
+ The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
+
+features: [Intl.DurationFormat, Symbol.toStringTag]
+---*/
+
+assert.sameValue(Object.prototype.toString.call(Intl.DurationFormat.prototype), "[object Intl.DurationFormat]");
+assert.sameValue(Object.prototype.toString.call(new Intl.DurationFormat()), "[object Intl.DurationFormat]");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toStringTag.js b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toStringTag.js
new file mode 100644
index 0000000000..f8cd2882d2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/toStringTag/toStringTag.js
@@ -0,0 +1,28 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+// Copyright 2022 Igalia, S.L. All rights reserved.
+
+/*---
+esid: sec-intl.DurationFormat.prototype-@@tostringtag
+description: >
+ Property descriptor of Intl.DurationFormat.prototype[@@toStringTag].
+info: |
+ Intl.DurationFormat.prototype [ @@toStringTag ]
+
+ The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+
+features: [Intl.DurationFormat, Symbol.toStringTag]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.DurationFormat.prototype, Symbol.toStringTag, {
+ value: "Intl.DurationFormat",
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/shell.js b/js/src/tests/test262/intl402/DurationFormat/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/shell.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/basic.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/basic.js
new file mode 100644
index 0000000000..300e1d24ee
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/basic.js
@@ -0,0 +1,22 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: Tests that Intl.DurationFormat has a supportedLocalesOf property, and it works as expected.
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function",
+ "supportedLocalesOf should be supported.");
+
+const defaultLocale = new Intl.DurationFormat().resolvedOptions().locale;
+const notSupported = "zxx"; // "no linguistic content"
+const requestedLocales = [defaultLocale, notSupported];
+
+const supportedLocales = Intl.DurationFormat.supportedLocalesOf(requestedLocales);
+assert.sameValue(supportedLocales.length, 1, "The length of the supported locales list should be 1");
+assert.sameValue(supportedLocales[0], defaultLocale, "The default locale is returned in the supported list.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/branding.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/branding.js
new file mode 100644
index 0000000000..d8ab61d338
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/branding.js
@@ -0,0 +1,35 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: >
+ Verifies there's no branding check for Intl.DurationFormat.supportedLocalesOf().
+info: |
+ Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
+features: [Intl.DurationFormat]
+---*/
+
+const supportedLocalesOf = Intl.DurationFormat.supportedLocalesOf;
+
+assert.sameValue(typeof supportedLocalesOf, "function");
+
+const thisValues = [
+ undefined,
+ null,
+ true,
+ "",
+ Symbol(),
+ 1,
+ {},
+ Intl.DurationFormat,
+ Intl.DurationFormat.prototype,
+];
+
+for (const thisValue of thisValues) {
+ const result = supportedLocalesOf.call(thisValue);
+ assert.sameValue(Array.isArray(result), true);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/browser.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/browser.js
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/length.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/length.js
new file mode 100644
index 0000000000..b3c6b3e1d2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/length.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: >
+ Checks the "length" property of Intl.DurationFormat.supportedLocalesOf().
+info: |
+ The value of the length property of the supportedLocalesOf method is 1.
+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
+ Every built-in function object, including constructors, has a length property whose value is an integer.
+ Unless otherwise specified, the length property of a built-in function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+verifyProperty(Intl.DurationFormat.supportedLocalesOf, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-empty.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-empty.js
new file mode 100644
index 0000000000..14fc1b0494
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-empty.js
@@ -0,0 +1,22 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: Checks handling of an empty locales argument to the supportedLocalesOf function.
+info: |
+ Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
+ (...)
+ 3. Return ? SupportedLocales(availableLocales, requestedLocales, options).
+includes: [compareArray.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function",
+ "Should support Intl.DurationFormat.supportedLocalesOf.");
+
+assert.compareArray(Intl.DurationFormat.supportedLocalesOf(), []);
+assert.compareArray(Intl.DurationFormat.supportedLocalesOf([]), []);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-invalid.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-invalid.js
new file mode 100644
index 0000000000..8f5e8c0e81
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-invalid.js
@@ -0,0 +1,23 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: Checks error cases for the locales argument to the supportedLocalesOf function.
+info: |
+ Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
+ (...)
+ 2. Let requestedLocales be CanonicalizeLocaleList(locales).
+includes: [testIntl.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function",
+ "Should support Intl.DurationFormat.supportedLocalesOf.");
+
+for (const [locales, expectedError] of getInvalidLocaleArguments()) {
+ assert.throws(expectedError, () => Intl.DurationFormat.supportedLocalesOf(locales));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-specific.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-specific.js
new file mode 100644
index 0000000000..77696d7ef0
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/locales-specific.js
@@ -0,0 +1,25 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: Checks handling of specific locales arguments to the supportedLocalesOf function.
+info: |
+ Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
+ (...)
+ 3. Return ? SupportedLocales(availableLocales, requestedLocales, options).
+includes: [compareArray.js]
+locale: [sr, sr-Thai-RS, de, zh-CN]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function",
+ "Should support Intl.DurationFormat.supportedLocalesOf.");
+
+assert.compareArray(Intl.DurationFormat.supportedLocalesOf("sr"), ["sr"]);
+
+const multiLocale = ["sr-Thai-RS", "de", "zh-CN"];
+assert.compareArray(Intl.DurationFormat.supportedLocalesOf(multiLocale, {localeMatcher: "lookup"}), multiLocale);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/name.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/name.js
new file mode 100644
index 0000000000..dc452628d0
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/name.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: >
+ Checks the "name" property of Intl.DurationFormat.supportedLocalesOf().
+info: |
+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
+ Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
+ Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+verifyProperty(Intl.DurationFormat.supportedLocalesOf, "name", {
+ value: "supportedLocalesOf",
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/prop-desc.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/prop-desc.js
new file mode 100644
index 0000000000..ff212a9704
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/prop-desc.js
@@ -0,0 +1,32 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.DurationFormat.supportedLocalesOf
+description: >
+ Checks the "supportedLocalesOf" property of the DurationFormat prototype object.
+info: |
+ Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
+
+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
+
+ Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
+includes: [propertyHelper.js]
+features: [Intl.DurationFormat]
+---*/
+
+assert.sameValue(
+ typeof Intl.DurationFormat.supportedLocalesOf,
+ "function",
+ "typeof Intl.DurationFormat.supportedLocalesOf is function"
+);
+
+verifyProperty(Intl.DurationFormat, "supportedLocalesOf", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/shell.js b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/shell.js