summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Locale/constructor-getter-order.js
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/Locale/constructor-getter-order.js
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/Locale/constructor-getter-order.js')
-rw-r--r--js/src/tests/test262/intl402/Locale/constructor-getter-order.js127
1 files changed, 127 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Locale/constructor-getter-order.js b/js/src/tests/test262/intl402/Locale/constructor-getter-order.js
new file mode 100644
index 0000000000..4948f22480
--- /dev/null
+++ b/js/src/tests/test262/intl402/Locale/constructor-getter-order.js
@@ -0,0 +1,127 @@
+// Copyright 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.locale
+description: >
+ Checks the order of evaluations of arguments and options for the Locale
+ constructor.
+features: [Intl.Locale]
+includes: [compareArray.js]
+---*/
+
+const order = [];
+new Intl.Locale(
+ { toString() { order.push("tag toString"); return "en"; } },
+ {
+ get language() {
+ order.push("get language");
+ return {
+ toString() {
+ order.push("toString language");
+ return "de";
+ }
+ }
+ },
+
+ get script() {
+ order.push("get script");
+ return {
+ toString() {
+ order.push("toString script");
+ return "Latn";
+ }
+ }
+ },
+
+ get region() {
+ order.push("get region");
+ return {
+ toString() {
+ order.push("toString region");
+ return "DE";
+ }
+ }
+ },
+
+ get calendar() {
+ order.push("get calendar");
+ return {
+ toString() {
+ order.push("toString calendar");
+ return "gregory";
+ }
+ }
+ },
+
+ get collation() {
+ order.push("get collation");
+ return {
+ toString() {
+ order.push("toString collation");
+ return "zhuyin";
+ }
+ }
+ },
+
+ get hourCycle() {
+ order.push("get hourCycle");
+ return {
+ toString() {
+ order.push("toString hourCycle");
+ return "h24";
+ }
+ }
+ },
+
+ get caseFirst() {
+ order.push("get caseFirst");
+ return {
+ toString() {
+ order.push("toString caseFirst");
+ return "upper";
+ }
+ }
+ },
+
+ get numeric() {
+ order.push("get numeric");
+ return false;
+ },
+
+ get numberingSystem() {
+ order.push("get numberingSystem");
+ return {
+ toString() {
+ order.push("toString numberingSystem");
+ return "latn";
+ }
+ }
+ },
+ }
+);
+
+const expected_order = [
+ "tag toString",
+ "get language",
+ "toString language",
+ "get script",
+ "toString script",
+ "get region",
+ "toString region",
+ "get calendar",
+ "toString calendar",
+ "get collation",
+ "toString collation",
+ "get hourCycle",
+ "toString hourCycle",
+ "get caseFirst",
+ "toString caseFirst",
+ "get numeric",
+ "get numberingSystem",
+ "toString numberingSystem"
+];
+
+assert.compareArray(order, expected_order);
+
+reportCompare(0, 0);