summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Date/prototype/toLocaleString
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/prototype/toLocaleString')
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js25
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js23
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js20
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js25
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js35
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/toLocaleString/shell.js0
11 files changed, 224 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js
new file mode 100644
index 0000000000..462d53f26b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js
@@ -0,0 +1,25 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The Date.prototype property "toLocaleString" has { DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking absence of ReadOnly attribute
+---*/
+
+var x = Date.prototype.toLocaleString;
+if (x === 1) {
+ Date.prototype.toLocaleString = 2;
+} else {
+ Date.prototype.toLocaleString = 1;
+}
+
+assert.notSameValue(
+ Date.prototype.toLocaleString,
+ x,
+ 'The value of Date.prototype.toLocaleString is expected to not equal the value of `x`'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js
new file mode 100644
index 0000000000..7048a1c8c4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The Date.prototype property "toLocaleString" has { DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking absence of DontDelete attribute
+---*/
+
+assert.notSameValue(
+ delete Date.prototype.toLocaleString,
+ false,
+ 'The value of delete Date.prototype.toLocaleString is not false'
+);
+
+assert(
+ !Date.prototype.hasOwnProperty('toLocaleString'),
+ 'The value of !Date.prototype.hasOwnProperty(\'toLocaleString\') is expected to be true'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js
new file mode 100644
index 0000000000..8cd0d560cc
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The Date.prototype property "toLocaleString" has { DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.propertyIsEnumerable('toLocaleString'),
+ 'The value of !Date.prototype.propertyIsEnumerable(\'toLocaleString\') is expected to be true'
+);
+
+for (var x in Date.prototype) {
+ assert.notSameValue(x, "toLocaleString", 'The value of x is not "toLocaleString"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js
new file mode 100644
index 0000000000..a99ec98052
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The "length" property of the "toLocaleString" is 0
+esid: sec-date.prototype.tolocalestring
+description: The "length" property of the "toLocaleString" is 0
+---*/
+
+assert.sameValue(
+ Date.prototype.toLocaleString.hasOwnProperty("length"),
+ true,
+ 'Date.prototype.toLocaleString.hasOwnProperty("length") must return true'
+);
+
+assert.sameValue(
+ Date.prototype.toLocaleString.length,
+ 0,
+ 'The value of Date.prototype.toLocaleString.length is expected to be 0'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js
new file mode 100644
index 0000000000..4537937e8b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js
@@ -0,0 +1,24 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The Date.prototype.toLocaleString property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking ReadOnly attribute
+includes: [propertyHelper.js]
+---*/
+
+var x = Date.prototype.toLocaleString.length;
+verifyNotWritable(Date.prototype.toLocaleString, "length", null, 1);
+
+assert.sameValue(
+ Date.prototype.toLocaleString.length,
+ x,
+ 'The value of Date.prototype.toLocaleString.length is expected to equal the value of x'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js
new file mode 100644
index 0000000000..29166bae06
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js
@@ -0,0 +1,25 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The Date.prototype.toLocaleString property "length" has { ReadOnly, !
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking DontDelete attribute
+---*/
+
+assert.sameValue(
+ delete Date.prototype.toLocaleString.length,
+ true,
+ 'The value of `delete Date.prototype.toLocaleString.length` is expected to be true'
+);
+
+assert(
+ !Date.prototype.toLocaleString.hasOwnProperty('length'),
+ 'The value of !Date.prototype.toLocaleString.hasOwnProperty(\'length\') is expected to be true'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js
new file mode 100644
index 0000000000..af48b9388e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The Date.prototype.toLocaleString property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.tolocalestring
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.toLocaleString.propertyIsEnumerable('length'),
+ 'The value of !Date.prototype.toLocaleString.propertyIsEnumerable(\'length\') is expected to be true'
+);
+
+for (var x in Date.prototype.toLocaleString) {
+ assert.notSameValue(x, "length", 'The value of x is not "length"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/browser.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/browser.js
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js
new file mode 100644
index 0000000000..1c2d1ad584
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-date.prototype.tolocalestring
+description: >
+ Date.prototype.toLocaleString.name is "toLocaleString".
+info: |
+ Date.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
+
+ 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]
+---*/
+
+assert.sameValue(Date.prototype.toLocaleString.name, "toLocaleString");
+
+verifyNotEnumerable(Date.prototype.toLocaleString, "name");
+verifyNotWritable(Date.prototype.toLocaleString, "name");
+verifyConfigurable(Date.prototype.toLocaleString, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js
new file mode 100644
index 0000000000..4af86cd1e6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js
@@ -0,0 +1,35 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+ Date.prototype.toLocaleString does not implement [[Construct]], is not new-able
+info: |
+ ECMAScript Function Objects
+
+ 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.
+
+ sec-evaluatenew
+
+ ...
+ 7. If IsConstructor(constructor) is false, throw a TypeError exception.
+ ...
+includes: [isConstructor.js]
+features: [Reflect.construct, arrow-function]
+---*/
+
+assert.sameValue(
+ isConstructor(Date.prototype.toLocaleString),
+ false,
+ 'isConstructor(Date.prototype.toLocaleString) must return false'
+);
+
+assert.throws(TypeError, () => {
+ let date = new Date(Date.now()); new date.toLocaleString();
+}, '`let date = new Date(Date.now()); new date.toLocaleString()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/shell.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/shell.js