summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Locale/prototype/toString
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Locale/prototype/toString')
-rw-r--r--js/src/tests/test262/intl402/Locale/prototype/toString/branding.js35
-rw-r--r--js/src/tests/test262/intl402/Locale/prototype/toString/browser.js0
-rw-r--r--js/src/tests/test262/intl402/Locale/prototype/toString/prop-desc.js30
-rw-r--r--js/src/tests/test262/intl402/Locale/prototype/toString/shell.js0
4 files changed, 65 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js b/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js
new file mode 100644
index 0000000000..8b14ec4fb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js
@@ -0,0 +1,35 @@
+// 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.prototype.toString
+description: >
+ Verifies the branding check for the "toString" function of the Locale prototype object.
+info: |
+ Intl.Locale.prototype.toString
+
+ 2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
+ a. Throw a TypeError exception.
+features: [Intl.Locale]
+---*/
+
+const toString = Intl.Locale.prototype.toString;
+
+assert.sameValue(typeof toString, "function");
+
+const invalidValues = [
+ undefined,
+ null,
+ true,
+ "",
+ Symbol(),
+ 1,
+ {},
+ Intl.Locale.prototype,
+];
+
+for (const invalidValue of invalidValues) {
+ assert.throws(TypeError, () => toString.call(invalidValue));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Locale/prototype/toString/browser.js b/js/src/tests/test262/intl402/Locale/prototype/toString/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/Locale/prototype/toString/browser.js
diff --git a/js/src/tests/test262/intl402/Locale/prototype/toString/prop-desc.js b/js/src/tests/test262/intl402/Locale/prototype/toString/prop-desc.js
new file mode 100644
index 0000000000..5ab7eaeac4
--- /dev/null
+++ b/js/src/tests/test262/intl402/Locale/prototype/toString/prop-desc.js
@@ -0,0 +1,30 @@
+// 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 "toString" property of the Locale prototype object.
+info: |
+ Intl.Locale.prototype.toString ()
+
+ 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.Locale]
+---*/
+
+assert.sameValue(
+ typeof Intl.Locale.prototype.toString,
+ "function",
+ "typeof Intl.Locale.prototype.toString is function"
+);
+
+verifyProperty(Intl.Locale.prototype, "toString", {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Locale/prototype/toString/shell.js b/js/src/tests/test262/intl402/Locale/prototype/toString/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/intl402/Locale/prototype/toString/shell.js