summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/PluralRules
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/intl402/PluralRules
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/intl402/PluralRules')
-rw-r--r--js/src/tests/test262/intl402/PluralRules/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/builtin.js21
-rw-r--r--js/src/tests/test262/intl402/PluralRules/can-be-subclassed.js30
-rw-r--r--js/src/tests/test262/intl402/PluralRules/constructor-option-read-order.js43
-rw-r--r--js/src/tests/test262/intl402/PluralRules/constructor-options-throwing-getters.js31
-rw-r--r--js/src/tests/test262/intl402/PluralRules/default-options-object-prototype.js20
-rw-r--r--js/src/tests/test262/intl402/PluralRules/internals.js19
-rw-r--r--js/src/tests/test262/intl402/PluralRules/length.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/name.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prop-desc.js33
-rw-r--r--js/src/tests/test262/intl402/PluralRules/proto-from-ctor-realm.js59
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/bind.js28
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/builtins.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/constructor/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/constructor/main.js14
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/constructor/prop-desc.js33
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/constructor/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/properties.js17
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/prototype.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/builtins.js30
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/length.js34
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/name.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/order.js34
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js32
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/prop-desc.js33
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/properties.js38
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/return-keys-order-default.js39
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/shell.js24
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/length.js34
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/name.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/non-finite.js24
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/prop-desc.js33
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/select/tainting.js22
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/argument-tonumber-throws.js26
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/default-en-us.js16
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/invoked-as-func.js23
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/length.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/name.js19
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/nan-arguments-throws.js23
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/prop-desc.js23
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/undefined-arguments-throws.js22
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/selectRange/x-greater-than-y-not-throws.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js30
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js24
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString.js26
-rw-r--r--js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toStringTag.js25
-rw-r--r--js/src/tests/test262/intl402/PluralRules/shell.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/arguments.js16
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/browser.js0
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/length.js34
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/main.js25
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/name.js18
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/prop-desc.js33
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/shell.js24
-rw-r--r--js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js30
-rw-r--r--js/src/tests/test262/intl402/PluralRules/undefined-newtarget-throws.js27
65 files changed, 1333 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/PluralRules/browser.js b/js/src/tests/test262/intl402/PluralRules/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/builtin.js b/js/src/tests/test262/intl402/PluralRules/builtin.js
new file mode 100644
index 0000000000..7979c93243
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/builtin.js
@@ -0,0 +1,21 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules
+description: >
+ Tests that Intl.PluralRules meets the requirements for
+ built-in objects defined by the introduction of chapter 17 of the
+ ECMAScript Language Specification.
+author: Zibi Braniecki
+---*/
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules), "[object Function]",
+ "The [[Class]] internal property of a built-in function must be " +
+ "\"Function\".");
+
+assert(Object.isExtensible(Intl.PluralRules), "Built-in objects must be extensible.");
+
+assert.sameValue(Object.getPrototypeOf(Intl.PluralRules), Function.prototype);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/can-be-subclassed.js b/js/src/tests/test262/intl402/PluralRules/can-be-subclassed.js
new file mode 100644
index 0000000000..e09c8b5f51
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/can-be-subclassed.js
@@ -0,0 +1,30 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-intl-pluralrules-constructor
+description: Tests that Intl.PluralRules can be subclassed.
+author: Zibi Braniecki
+includes: [compareArray.js]
+---*/
+
+// get a plural-rules and have it format an array of dates for comparison with the subclass
+var locales = ["tlh", "id", "en"];
+var a = [1, 5, 12];
+
+var referencePluralRules = new Intl.PluralRules(locales);
+var referenceSelected = a.map(referencePluralRules.select.bind(referencePluralRules));
+
+class MyPluralRules extends Intl.PluralRules {
+ constructor(locales, options) {
+ super(locales, options);
+ // could initialize MyPluralRules properties
+ }
+ // could add methods to MyPluralRules.prototype
+}
+
+var pr = new MyPluralRules(locales);
+var actual = a.map(pr.select.bind(pr));
+assert.compareArray(actual, referenceSelected);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/constructor-option-read-order.js b/js/src/tests/test262/intl402/PluralRules/constructor-option-read-order.js
new file mode 100644
index 0000000000..0fc3569e60
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/constructor-option-read-order.js
@@ -0,0 +1,43 @@
+// Copyright 2023 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-initializepluralrules
+description: Checks the order of option read.
+features: [Intl.NumberFormat-v3]
+includes: [compareArray.js]
+---*/
+
+let optionKeys = [
+ // Inside InitializePluralRules
+ "localeMatcher",
+ "type",
+ // Inside SetNumberFormatDigitOptions
+ "minimumIntegerDigits",
+ "minimumFractionDigits",
+ "maximumFractionDigits",
+ "minimumSignificantDigits",
+ "maximumSignificantDigits",
+ "roundingIncrement",
+ "roundingMode",
+ "roundingPriority",
+ "trailingZeroDisplay",
+ // End of SetNumberFormatDigitOptions
+];
+
+// Use getters to track the order of reading known properties.
+// TODO: Should we use a Proxy to detect *unexpected* property reads?
+let reads = new Array();
+let options = {};
+optionKeys.forEach((key) => {
+ Object.defineProperty(options, key, {
+ get() {
+ reads.push(key);
+ return undefined;
+ },
+ });
+});
+new Intl.PluralRules(undefined, options);
+assert.compareArray(reads, optionKeys, "Intl.PluralRules options read order");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/constructor-options-throwing-getters.js b/js/src/tests/test262/intl402/PluralRules/constructor-options-throwing-getters.js
new file mode 100644
index 0000000000..3099b1d1a2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/constructor-options-throwing-getters.js
@@ -0,0 +1,31 @@
+// Copyright 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-initializepluralrules
+description: Checks the propagation of exceptions from the options for the NumberFormat constructor.
+---*/
+
+function CustomError() {}
+
+const options = [
+ "localeMatcher",
+ "type",
+ "minimumIntegerDigits",
+ "minimumFractionDigits",
+ "maximumFractionDigits",
+ "minimumSignificantDigits",
+ "maximumSignificantDigits",
+];
+
+for (const option of options) {
+ assert.throws(CustomError, () => {
+ new Intl.PluralRules("en", {
+ get [option]() {
+ throw new CustomError();
+ }
+ });
+ }, `Exception from ${option} getter should be propagated`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/default-options-object-prototype.js b/js/src/tests/test262/intl402/PluralRules/default-options-object-prototype.js
new file mode 100644
index 0000000000..fc837a2e2c
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/default-options-object-prototype.js
@@ -0,0 +1,20 @@
+// Copyright (C) 2017 Igalia, S. L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-initializepluralrules
+description: >
+ Monkey-patching Object.prototype does not change the default
+ options for PluralRules as a null prototype is used.
+info: |
+ InitializePluralRules ( collator, locales, options )
+
+ 1. If _options_ is *undefined*, then
+ 1. Let _options_ be ObjectCreate(*null*).
+---*/
+
+Object.prototype.type = "ordinal";
+let pluralRules = new Intl.PluralRules("en");
+assert.sameValue(pluralRules.resolvedOptions().type, "cardinal");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/internals.js b/js/src/tests/test262/intl402/PluralRules/internals.js
new file mode 100644
index 0000000000..db0b3a19b9
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/internals.js
@@ -0,0 +1,19 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-intl-pluralrules-constructor
+description: >
+ Tests that objects constructed by Intl.PluralRules have the specified
+ internal properties.
+author: Zibi Braniecki
+---*/
+
+var obj = new Intl.PluralRules();
+
+var actualPrototype = Object.getPrototypeOf(obj);
+assert.sameValue(actualPrototype, Intl.PluralRules.prototype, "Prototype of object constructed by Intl.PluralRules isn't Intl.PluralRules.prototype; got " + actualPrototype);
+
+assert(Object.isExtensible(obj), "Object constructed by Intl.PluralRules must be extensible.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/length.js b/js/src/tests/test262/intl402/PluralRules/length.js
new file mode 100644
index 0000000000..cc2ea11067
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/length.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules
+description: Intl.PluralRules.length.
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules, 'length', {
+ value: 0,
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/name.js b/js/src/tests/test262/intl402/PluralRules/name.js
new file mode 100644
index 0000000000..fdcfd0ae70
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/name.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules
+description: Intl.PluralRules.name is "PluralRules"
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules, 'name', {
+ value: 'PluralRules',
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/prop-desc.js
new file mode 100644
index 0000000000..d21a3fec88
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prop-desc.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules
+description: >
+ "PluralRules" property of Intl.
+info: |
+ Intl.PluralRules (...)
+
+ 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.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl, 'PluralRules', {
+ writable: true,
+ enumerable: false,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/proto-from-ctor-realm.js b/js/src/tests/test262/intl402/PluralRules/proto-from-ctor-realm.js
new file mode 100644
index 0000000000..c5834ea464
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/proto-from-ctor-realm.js
@@ -0,0 +1,59 @@
+// Copyright (C) 2019 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules
+description: Default [[Prototype]] value derived from realm of the NewTarget.
+info: |
+ Intl.PluralRules ( [ locales [ , options ] ] )
+
+ 1. If NewTarget is undefined, throw a TypeError exception.
+ 2. Let pluralRules be ? OrdinaryCreateFromConstructor(newTarget, "%PluralRulesPrototype%", « ... »).
+ 3. Return ? InitializePluralRules(pluralRules, locales, options).
+
+ OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
+
+ ...
+ 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).
+ 3. Return ObjectCreate(proto, internalSlotsList).
+
+ GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
+
+ ...
+ 3. Let proto be ? Get(constructor, 'prototype').
+ 4. If Type(proto) is not Object, then
+ a. Let realm be ? GetFunctionRealm(constructor).
+ b. Set proto to realm's intrinsic object named intrinsicDefaultProto.
+ 5. Return proto.
+features: [cross-realm, Reflect, Symbol]
+---*/
+
+var other = $262.createRealm().global;
+var newTarget = new other.Function();
+var pr;
+
+newTarget.prototype = undefined;
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is undefined');
+
+newTarget.prototype = null;
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is null');
+
+newTarget.prototype = false;
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is a Boolean');
+
+newTarget.prototype = '';
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is a String');
+
+newTarget.prototype = Symbol();
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is a Symbol');
+
+newTarget.prototype = 0;
+pr = Reflect.construct(Intl.PluralRules, [], newTarget);
+assert.sameValue(Object.getPrototypeOf(pr), other.Intl.PluralRules.prototype, 'newTarget.prototype is a Number');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/bind.js b/js/src/tests/test262/intl402/PluralRules/prototype/bind.js
new file mode 100644
index 0000000000..9b5142866c
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/bind.js
@@ -0,0 +1,28 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-properties-of-intl-pluralrules-prototype-object
+description: >
+ Tests that Intl.PluralRules.prototype functions throw a TypeError if
+ called on a non-object value or an object that hasn't been
+ initialized as a PluralRules.
+author: Zibi Braniecki
+---*/
+
+var functions = {
+ select: Intl.PluralRules.prototype.select,
+ resolvedOptions: Intl.PluralRules.prototype.resolvedOptions
+};
+var invalidTargets = [undefined, null, true, 0, "PluralRules", [], {}];
+
+Object.getOwnPropertyNames(functions).forEach(function (functionName) {
+ var f = functions[functionName];
+ invalidTargets.forEach(function (target) {
+ assert.throws(TypeError, function () {
+ f.call(target);
+ }, "Calling " + functionName + " on " + target + " was not rejected.");
+ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/builtins.js b/js/src/tests/test262/intl402/PluralRules/prototype/builtins.js
new file mode 100644
index 0000000000..22bc883a14
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/builtins.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-properties-of-intl-pluralrules-prototype-object
+description: >
+ Tests that Intl.PluralRules.prototype meets the requirements for
+ built-in objects defined by the introduction of chapter 17 of the
+ ECMAScript Language Specification.
+author: Zibi Braniecki
+---*/
+
+assert(Object.isExtensible(Intl.PluralRules.prototype), "Built-in objects must be extensible.");
+
+assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.prototype), Object.prototype,
+ "Built-in prototype objects must have Object.prototype as their prototype.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/constructor/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/constructor/main.js b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/main.js
new file mode 100644
index 0000000000..8a3bb64e8c
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/main.js
@@ -0,0 +1,14 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.constructor
+description: >
+ Tests that Intl.PluralRules.prototype is an object that has been
+ initialized as an Intl.PluralRules.
+author: Zibi Braniecki
+---*/
+
+assert.sameValue(Intl.PluralRules.prototype.constructor, Intl.PluralRules, "Intl.PluralRules.prototype.constructor is not the same as Intl.PluralRules");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/constructor/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/prop-desc.js
new file mode 100644
index 0000000000..cada231f2e
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/prop-desc.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype.constructor
+description: >
+ "constructor" property of Intl.PluralRules.prototype.
+info: |
+ Intl.PluralRules.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.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype, "constructor", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/constructor/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/constructor/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/properties.js b/js/src/tests/test262/intl402/PluralRules/prototype/properties.js
new file mode 100644
index 0000000000..d30b187e6c
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/properties.js
@@ -0,0 +1,17 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-properties-of-intl-pluralrules-prototype-object
+description: Tests that Intl.PluralRules.prototype has the required attributes.
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules, "prototype", {
+ writable: false,
+ enumerable: false,
+ configurable: false,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/prototype.js b/js/src/tests/test262/intl402/PluralRules/prototype/prototype.js
new file mode 100644
index 0000000000..6329c09f5f
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/prototype.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-properties-of-intl-pluralrules-prototype-object
+description: >
+ Tests that Intl.PluralRules.prototype is not an object that has been
+ initialized as an Intl.PluralRules.
+author: Zibi Braniecki
+---*/
+
+// test by calling a function that fails if "this" is not an object
+// initialized as an Intl.PluralRules
+assert.throws(TypeError, function() {
+ Intl.PluralRules.prototype.select(0);
+}, "Intl.PluralRules.prototype is not an object that has been initialized as an Intl.PluralRules");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/builtins.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/builtins.js
new file mode 100644
index 0000000000..72e8ef9d1f
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/builtins.js
@@ -0,0 +1,30 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.resolvedOptions
+description: >
+ Tests that Intl.PluralRules.prototype.resolvedOptions meets the requirements for
+ built-in objects defined by the introduction of chapter 17 of the
+ ECMAScript Language Specification.
+author: Zibi Braniecki
+includes: [isConstructor.js]
+features: [Reflect.construct]
+---*/
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype.resolvedOptions), "[object Function]",
+ "The [[Class]] internal property of a built-in function must be " +
+ "\"Function\".");
+
+assert(Object.isExtensible(Intl.PluralRules.prototype.resolvedOptions),
+ "Built-in objects must be extensible.");
+
+assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.prototype.resolvedOptions), Function.prototype);
+
+assert.sameValue(Intl.PluralRules.prototype.resolvedOptions.hasOwnProperty("prototype"), false,
+ "Built-in functions that aren't constructors must not have a prototype property.");
+
+assert.sameValue(isConstructor(Intl.PluralRules.prototype.resolvedOptions), false,
+ "Built-in functions don't implement [[Construct]] unless explicitly specified.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/length.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/length.js
new file mode 100644
index 0000000000..74b670ed70
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/length.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype.resolvedoptions
+description: >
+ Intl.PluralRules.prototype.resolvedOptions.length is 0.
+info: |
+ Intl.PluralRules.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 }.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.resolvedOptions, "length", {
+ value: 0,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/name.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/name.js
new file mode 100644
index 0000000000..0bb3ab8903
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/name.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.resolvedOptions.name
+description: Intl.PluralRules.resolvedOptions.name is "resolvedOptions"
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.resolvedOptions, "name", {
+ value: "resolvedOptions",
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/order.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/order.js
new file mode 100644
index 0000000000..4d39e632eb
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/order.js
@@ -0,0 +1,34 @@
+// Copyright 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.numberformat.prototype.resolvedoptions
+description: Verifies the property order for the object returned by resolvedOptions().
+features: [Intl.NumberFormat-unified]
+---*/
+
+const options = new Intl.PluralRules([], {
+ "minimumSignificantDigits": 1,
+ "maximumSignificantDigits": 2,
+}).resolvedOptions();
+
+const expected = [
+ "locale",
+ "type",
+ "minimumIntegerDigits",
+ "minimumSignificantDigits",
+ "maximumSignificantDigits",
+ "pluralCategories",
+];
+
+const actual = Object.getOwnPropertyNames(options);
+
+// Ensure all expected items are in actual and also allow other properties
+// implemented in new proposals.
+assert(actual.indexOf("locale") > -1, "\"locale\" is present");
+for (var i = 1; i < expected.length; i++) {
+ // Ensure the order as expected but allow additional new property in between
+ assert(actual.indexOf(expected[i-1]) < actual.indexOf(expected[i]), `"${expected[i-1]}" precedes "${expected[i]}"`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js
new file mode 100644
index 0000000000..9fb31b7d4f
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js
@@ -0,0 +1,32 @@
+// Copyright 2018 Igalia S.L. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.resolvedOptions
+description: >
+ Tests that Intl.PluralRules.prototype.resolvedOptions creates a new array
+ for the pluralCategories property on every call.
+includes: [propertyHelper.js, compareArray.js]
+features: [Array.prototype.includes]
+---*/
+
+const allowedValues = ["zero", "one", "two", "few", "many", "other"];
+
+const pluralrules = new Intl.PluralRules();
+const options1 = pluralrules.resolvedOptions();
+const options2 = pluralrules.resolvedOptions();
+
+assert.notSameValue(options1.pluralCategories, options2.pluralCategories, "Should have different arrays");
+assert.compareArray(options1.pluralCategories, options2.pluralCategories, "Arrays should have same values");
+
+for (const category of options1.pluralCategories) {
+ assert(allowedValues.includes(category), `Found ${category}, expected one of ${allowedValues}`);
+}
+
+verifyProperty(options1, "pluralCategories", {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/prop-desc.js
new file mode 100644
index 0000000000..9cacaeed90
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/prop-desc.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype.resolvedoptions
+description: >
+ "resolvedOptions" property of Intl.PluralRules.prototype.
+info: |
+ Intl.PluralRules.prototype.resolvedOptions ()
+
+ 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.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype, "resolvedOptions", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/properties.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/properties.js
new file mode 100644
index 0000000000..1db3cb1927
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/properties.js
@@ -0,0 +1,38 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.resolvedOptions
+description: >
+ Tests that the object returned by
+ Intl.PluralRules.prototype.resolvedOptions has the right
+ properties.
+author: Zibi Braniecki
+includes: [testIntl.js, propertyHelper.js]
+---*/
+
+var actual = new Intl.PluralRules().resolvedOptions();
+
+var actual2 = new Intl.PluralRules().resolvedOptions();
+assert.notSameValue(actual2, actual, "resolvedOptions returned the same object twice.");
+
+// this assumes the default values where the specification provides them
+assert(isCanonicalizedStructurallyValidLanguageTag(actual.locale),
+ "Invalid locale: " + actual.locale);
+assert.sameValue(actual.type, "cardinal");
+assert.sameValue(actual.minimumIntegerDigits, 1);
+assert.sameValue(actual.minimumFractionDigits, 0);
+assert.sameValue(actual.maximumFractionDigits, 3);
+
+var dataPropertyDesc = { writable: true, enumerable: true, configurable: true };
+verifyProperty(actual, "locale", dataPropertyDesc);
+verifyProperty(actual, "type", dataPropertyDesc);
+verifyProperty(actual, "currency", undefined);
+verifyProperty(actual, "currencyDisplay", undefined);
+verifyProperty(actual, "minimumIntegerDigits", dataPropertyDesc);
+verifyProperty(actual, "minimumFractionDigits", dataPropertyDesc);
+verifyProperty(actual, "maximumFractionDigits", dataPropertyDesc);
+verifyProperty(actual, "minimumSignificantDigits", undefined);
+verifyProperty(actual, "maximumSignificantDigits", undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/return-keys-order-default.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/return-keys-order-default.js
new file mode 100644
index 0000000000..e1dda53bc6
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/return-keys-order-default.js
@@ -0,0 +1,39 @@
+// Copyright 2023 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-intl.pluralrules.prototype.resolvedoptions
+description: order of property keys for the object returned by resolvedOptions()
+features: [Intl.NumberFormat-v3]
+includes: [compareArray.js]
+---*/
+
+const allKeys = [
+ 'locale',
+ 'type',
+ 'minimumIntegerDigits',
+ 'minimumFractionDigits',
+ 'maximumFractionDigits',
+ 'minimumSignificantDigits',
+ 'maximumSignificantDigits',
+ 'pluralCategories',
+ 'roundingIncrement',
+ 'roundingMode',
+ 'roundingPriority',
+ 'trailingZeroDisplay'
+];
+
+const options = [
+ { },
+ { minimumSignificantDigits: 3 },
+ { minimumFractionDigits: 3 },
+];
+options.forEach((option) => {
+ const nf = new Intl.PluralRules(undefined, option);
+ const resolved = nf.resolvedOptions();
+ const resolvedKeys = Reflect.ownKeys(resolved);
+ const expectedKeys = allKeys.filter(key => key in resolved);
+ assert.compareArray(resolvedKeys, expectedKeys,
+ 'resolvedOptions() property key order with options ' + JSON.stringify(options));
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/resolvedOptions/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/PluralRules/prototype/select/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/length.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/length.js
new file mode 100644
index 0000000000..9b058ed2c2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/length.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype.select
+description: >
+ Intl.PluralRules.prototype.select is 1.
+info: |
+ Intl.PluralRules.prototype.select( value )
+
+ 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 }.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.select, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/name.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/name.js
new file mode 100644
index 0000000000..1cb40c0345
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/name.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.select
+description: Intl.PluralRules.prototype.select.name is "select"
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.select, "name", {
+ value: "select",
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/non-finite.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/non-finite.js
new file mode 100644
index 0000000000..14166d66ec
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/non-finite.js
@@ -0,0 +1,24 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.select
+description: Tests that select function returns "other" for non finite values.
+info: |
+ 1.1.4. ResolvePlural (pluralRules, n)
+ (...)
+ 1.1.4_3. If isFinite(n) is false, then
+ 1.1.4_3.a. Return "other".
+author: Zibi Braniecki
+
+---*/
+
+var invalidValues = [NaN, Infinity, -Infinity];
+
+var pr = new Intl.PluralRules();
+
+invalidValues.forEach(function (value) {
+ assert.sameValue(pr.select(value), "other");
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/prop-desc.js
new file mode 100644
index 0000000000..487c60a182
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/prop-desc.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype.select
+description: >
+ "select" property of Intl.PluralRules.prototype.
+info: |
+ Intl.PluralRules.prototype.select( value )
+
+ 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.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype, "select", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/select/tainting.js b/js/src/tests/test262/intl402/PluralRules/prototype/select/tainting.js
new file mode 100644
index 0000000000..19dc9eddc5
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/select/tainting.js
@@ -0,0 +1,22 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-intl-pluralrules-abstracts
+description: >
+ Tests that the behavior of a Record is not affected by
+ adversarial changes to Object.prototype.
+info: |
+ 1.1.1. InitializePluralRules (pluralRules, locales, options)
+ (...)
+ 1.1.1_6. Let t be ? GetOption(options, "type", "string", « "cardinal", "ordinal" », "cardinal").
+author: Zibi Braniecki
+includes: [testIntl.js]
+---*/
+
+taintProperties(["type"]);
+
+var pr = new Intl.PluralRules();
+var time = pr.select(9);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/argument-tonumber-throws.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/argument-tonumber-throws.js
new file mode 100644
index 0000000000..2d37519d26
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/argument-tonumber-throws.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: >
+ "selectRange" basic tests when argument cannot be converted using ToNumber
+info: |
+ Intl.PluralRules.prototype.selectRange ( start, end )
+ (...)
+ 4. Let x be ? ToNumber(start).
+ 5. Let y be ? ToNumber(end).
+locale: [en-US]
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules("en-US");
+
+// Throw if arguments cannot be cast toNumber
+assert.throws(TypeError, () => { pr.selectRange(Symbol(102), 201) });
+assert.throws(TypeError, () => { pr.selectRange(102,Symbol(201)) });
+assert.throws(TypeError, () => { pr.selectRange(23n, 100) });
+assert.throws(TypeError, () => { pr.selectRange(100, 23n) });
+assert.throws(TypeError, () => { pr.selectRange(23n, 23n) });
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/default-en-us.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/default-en-us.js
new file mode 100644
index 0000000000..75222d5c9b
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/default-en-us.js
@@ -0,0 +1,16 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Intl.PluralRules.prototype.selectRange default behaviour returning "few" or "other"
+locale: [en-US]
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules("en-US");
+
+assert.sameValue(pr.selectRange(102, 201), "other");
+assert.sameValue(pr.selectRange(200, 200), "other");
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/invoked-as-func.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/invoked-as-func.js
new file mode 100644
index 0000000000..27a9913106
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/invoked-as-func.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: basic tests internal slot initialization and call receiver errors
+info: |
+ Intl.PluralRules.prototype.selectRange(start, end )
+ (...)
+ 2. Perform ? RequireInternalSlot(pr, [[InitializedPluralRules]])
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules();
+
+// Perform ? RequireInternalSlot(pr, [[InitializedPluralRules]]).
+let sr = pr['selectRange'];
+
+assert.sameValue(typeof sr, 'function');
+assert.throws(TypeError, () => { sr(1, 23) });
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/length.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/length.js
new file mode 100644
index 0000000000..56f550c301
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/length.js
@@ -0,0 +1,18 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: Intl.PluralRules.prototype.selectRange.length is 2
+includes: [propertyHelper.js]
+features: [Intl.NumberFormat-v3]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.selectRange, 'length', {
+ value: 2,
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/name.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/name.js
new file mode 100644
index 0000000000..d58906b69e
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/name.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: Intl.PluralRules.prototype.selectRange.name is "selectRange"
+includes: [propertyHelper.js]
+features: [Intl.NumberFormat-v3]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype.selectRange, 'name', {
+ value: 'selectRange',
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/nan-arguments-throws.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/nan-arguments-throws.js
new file mode 100644
index 0000000000..6a216ef218
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/nan-arguments-throws.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: >
+ "selectRange" Throws a RangeError if some of arguments is cast to NaN
+info: |
+ Intl.PluralRules.prototype.selectRange ( start, end )
+ (...)
+ WIP: https://github.com/tc39/proposal-intl-numberformat-v3/pull/76
+
+
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules();
+
+assert.throws(RangeError, () => { pr.selectRange(NaN, 100) }, "NaN/Number");
+assert.throws(RangeError, () => { pr.selectRange(100, NaN) }, "Number/NaN");
+assert.throws(RangeError, () => { pr.selectRange(NaN, NaN) }, "NaN/NaN");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/prop-desc.js
new file mode 100644
index 0000000000..7a770e99c0
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/prop-desc.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: Property descriptor of Intl.PluralRules.prototype.selectRange
+includes: [propertyHelper.js]
+features: [Intl.NumberFormat-v3]
+---*/
+
+assert.sameValue(
+ typeof Intl.PluralRules.prototype.selectRange,
+ 'function',
+ '`typeof Intl.PluralRules.prototype.selectRange` is `function`'
+);
+
+verifyProperty(Intl.PluralRules.prototype, 'selectRange', {
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/undefined-arguments-throws.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/undefined-arguments-throws.js
new file mode 100644
index 0000000000..0d85153681
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/undefined-arguments-throws.js
@@ -0,0 +1,22 @@
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRange
+description: >
+ "selectRange" basic tests when arguments are undefined throw a TypeError exception.
+info: |
+ Intl.PluralRules.prototype.selectRange ( start, end )
+ (...)
+ 3. If start is undefined or end is undefined, throw a TypeError exception.
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules();
+
+// 1. If arguments are undefined throw a TypeError exception.
+assert.throws(TypeError, () => { pr.selectRange(undefined, 201) });
+assert.throws(TypeError, () => { pr.selectRange(102, undefined) });
+assert.throws(TypeError, () => { pr.selectRange(undefined, undefined)});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/x-greater-than-y-not-throws.js b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/x-greater-than-y-not-throws.js
new file mode 100644
index 0000000000..410baa4df4
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/selectRange/x-greater-than-y-not-throws.js
@@ -0,0 +1,18 @@
+// Copyright 2022 Google, Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.prototype.selectRang
+description: >
+ "selectRange" basic tests when argument x > y, return a string.
+info: |
+ 1.1.6 ResolvePluralRange ( pluralRules, x, y )
+features: [Intl.NumberFormat-v3]
+---*/
+
+const pr = new Intl.PluralRules();
+
+// 1. If x > y, return a string.
+assert.sameValue(typeof pr.selectRange(201, 102), "string", "should not throw RangeError");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/browser.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/shell.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js
new file mode 100644
index 0000000000..20b48fcc35
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype-tostringtag
+description: >
+ Object.prototype.toString utilizes Intl.PluralRules.prototype[@@toStringTag].
+info: |
+ Object.prototype.toString ( )
+
+ [...]
+ 14. Else, let builtinTag be "Object".
+ 15. Let tag be ? Get(O, @@toStringTag).
+ 16. If Type(tag) is not String, set tag to builtinTag.
+ 17. Return the string-concatenation of "[object ", tag, and "]".
+
+ Intl.PluralRules.prototype [ @@toStringTag ]
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+features: [Symbol.toStringTag]
+---*/
+
+Object.defineProperty(Intl.PluralRules.prototype, Symbol.toStringTag, {
+ value: "test262",
+});
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object test262]");
+assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object test262]");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js
new file mode 100644
index 0000000000..02f835ff2f
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js
@@ -0,0 +1,24 @@
+// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype-tostringtag
+description: >
+ Object.prototype.toString doesn't special-case neither Intl.PluralRules instances nor its prototype.
+info: |
+ Object.prototype.toString ( )
+
+ [...]
+ 14. Else, let builtinTag be "Object".
+ 15. Let tag be ? Get(O, @@toStringTag).
+ 16. If Type(tag) is not String, set tag to builtinTag.
+ 17. Return the string-concatenation of "[object ", tag, and "]".
+features: [Symbol.toStringTag]
+---*/
+
+delete Intl.PluralRules.prototype[Symbol.toStringTag];
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Object]");
+assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Object]");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString.js
new file mode 100644
index 0000000000..e5a30f15e4
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toString.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype-tostringtag
+description: >
+ Object.prototype.toString utilizes Intl.PluralRules.prototype[@@toStringTag].
+info: |
+ Object.prototype.toString ( )
+
+ [...]
+ 14. Else, let builtinTag be "Object".
+ 15. Let tag be ? Get(O, @@toStringTag).
+ 16. If Type(tag) is not String, set tag to builtinTag.
+ 17. Return the string-concatenation of "[object ", tag, and "]".
+
+ Intl.PluralRules.prototype [ @@toStringTag ]
+
+ The initial value of the @@toStringTag property is the String value "Intl.PluralRules".
+features: [Symbol.toStringTag]
+---*/
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Intl.PluralRules]");
+assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Intl.PluralRules]");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toStringTag.js b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toStringTag.js
new file mode 100644
index 0000000000..cdac2facc9
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/prototype/toStringTag/toStringTag.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.prototype-tostringtag
+description: >
+ Property descriptor of Intl.PluralRules.prototype[@@toStringTag].
+info: |
+ Intl.PluralRules.prototype [ @@toStringTag ]
+
+ The initial value of the @@toStringTag property is the String value "Intl.PluralRules".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+features: [Symbol.toStringTag]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.prototype, Symbol.toStringTag, {
+ value: "Intl.PluralRules",
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/shell.js b/js/src/tests/test262/intl402/PluralRules/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/shell.js
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/arguments.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/arguments.js
new file mode 100644
index 0000000000..bf6e487d6e
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/arguments.js
@@ -0,0 +1,16 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.supportedLocalesOf
+description: >
+ Tests that Intl.PluralRules.supportedLocalesOf doesn't access
+ arguments that it's not given.
+author: Zibi Braniecki
+includes: [testIntl.js]
+---*/
+
+taintDataProperty(Object.prototype, "1");
+new Intl.PluralRules("und");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/browser.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/browser.js
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/length.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/length.js
new file mode 100644
index 0000000000..b4c149490f
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/length.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.supportedlocalesof
+description: >
+ Intl.PluralRules.supportedLocalesOf.length is 1.
+info: |
+ Intl.PluralRules.supportedLocalesOf ( 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 }.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.supportedLocalesOf, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/main.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/main.js
new file mode 100644
index 0000000000..23afcb1099
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/main.js
@@ -0,0 +1,25 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.supportedLocalesOf
+description: >
+ Tests that Intl.PluralRules has a supportedLocalesOf property, and
+ it works as planned.
+author: Zibi Braniecki
+---*/
+
+var defaultLocale = new Intl.PluralRules().resolvedOptions().locale;
+var notSupported = 'zxx'; // "no linguistic content"
+var requestedLocales = [defaultLocale, notSupported];
+
+var supportedLocales;
+
+assert(Intl.PluralRules.hasOwnProperty('supportedLocalesOf'), "Intl.PluralRules doesn't have a supportedLocalesOf property.");
+
+supportedLocales = Intl.PluralRules.supportedLocalesOf(requestedLocales);
+assert.sameValue(supportedLocales.length, 1, 'The length of supported locales list is not 1.');
+
+assert.sameValue(supportedLocales[0], defaultLocale, 'The default locale is not returned in the supported list.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/name.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/name.js
new file mode 100644
index 0000000000..e6f9f83251
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/name.js
@@ -0,0 +1,18 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.supportedLocalesOf
+description: Tests that Intl.PluralRules.supportedLocalesOf.name is "supportedLocalesOf"
+author: Zibi Braniecki
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules.supportedLocalesOf, "name", {
+ value: "supportedLocalesOf",
+ writable: false,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/prop-desc.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/prop-desc.js
new file mode 100644
index 0000000000..f410605873
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/prop-desc.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.pluralrules.supportedlocalesof
+description: >
+ "supportedLocalesOf" property of Intl.PluralRules.
+info: |
+ Intl.PluralRules.supportedLocalesOf ( 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.
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(Intl.PluralRules, "supportedLocalesOf", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/shell.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/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/PluralRules/supportedLocalesOf/supportedLocalesOf.js b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js
new file mode 100644
index 0000000000..1bff8cdb1c
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js
@@ -0,0 +1,30 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules.supportedLocalesOf
+description: >
+ Tests that Intl.PluralRules.supportedLocalesOf meets the requirements for
+ built-in objects defined by the introduction of chapter 17 of the
+ ECMAScript Language Specification.
+author: Zibi Braniecki
+includes: [isConstructor.js]
+features: [Reflect.construct]
+---*/
+
+assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.supportedLocalesOf), "[object Function]",
+ "The [[Class]] internal property of a built-in function must be " +
+ "\"Function\".");
+
+assert(Object.isExtensible(Intl.PluralRules.supportedLocalesOf),
+ "Built-in objects must be extensible.");
+
+assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.supportedLocalesOf), Function.prototype);
+
+assert.sameValue(Intl.PluralRules.supportedLocalesOf.hasOwnProperty("prototype"), false,
+ "Built-in functions that aren't constructors must not have a prototype property.");
+
+assert.sameValue(isConstructor(Intl.PluralRules.supportedLocalesOf), false,
+ "Built-in functions don't implement [[Construct]] unless explicitly specified.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/PluralRules/undefined-newtarget-throws.js b/js/src/tests/test262/intl402/PluralRules/undefined-newtarget-throws.js
new file mode 100644
index 0000000000..77c82be1de
--- /dev/null
+++ b/js/src/tests/test262/intl402/PluralRules/undefined-newtarget-throws.js
@@ -0,0 +1,27 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.PluralRules
+description: Tests that PluralRules throws when called as a function
+author: Zibi Braniecki
+includes: [testIntl.js]
+---*/
+
+assert.throws(TypeError, function() {
+ Intl.PluralRules();
+}, "Intl.PluralRules throws when called as a function");
+
+assert.throws(TypeError, function() {
+ Intl.PluralRules.call(undefined);
+}, "Intl.PluralRules throws when called as a function with |undefined| as this-value");
+
+testWithIntlConstructors(function (Constructor) {
+ var obj = new Constructor();
+
+ assert.throws(TypeError, function() {
+ Intl.PluralRules.call(obj)
+ }, "Intl.PluralRules throws when called as a function with an Intl-object as this-value");
+});
+
+reportCompare(0, 0);