summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds')
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js27
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js21
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/arg-coercion-order.js32
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js35
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/shell.js0
12 files changed, 259 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js
new file mode 100644
index 0000000000..a3770024c8
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js
@@ -0,0 +1,27 @@
+// 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 "setUTCMilliseconds" has { DontEnum }
+ attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking absence of ReadOnly attribute
+---*/
+
+var x = Date.prototype.setUTCMilliseconds;
+if (x === 1) {
+ Date.prototype.setUTCMilliseconds = 2;
+} else {
+ Date.prototype.setUTCMilliseconds = 1;
+}
+
+assert.notSameValue(
+ Date.prototype.setUTCMilliseconds,
+ x,
+ 'The value of Date.prototype.setUTCMilliseconds 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/setUTCMilliseconds/S15.9.5.29_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js
new file mode 100644
index 0000000000..a539610d4a
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.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 property "setUTCMilliseconds" has { DontEnum }
+ attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking absence of DontDelete attribute
+---*/
+assert.notSameValue(
+ delete Date.prototype.setUTCMilliseconds,
+ false,
+ 'The value of delete Date.prototype.setUTCMilliseconds is not false'
+);
+
+assert(
+ !Date.prototype.hasOwnProperty('setUTCMilliseconds'),
+ 'The value of !Date.prototype.hasOwnProperty(\'setUTCMilliseconds\') is expected to be true'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js
new file mode 100644
index 0000000000..a7508f1b58
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_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 property "setUTCMilliseconds" has { DontEnum }
+ attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.propertyIsEnumerable('setUTCMilliseconds'),
+ 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMilliseconds\') is expected to be true'
+);
+
+for (var x in Date.prototype) {
+ assert.notSameValue(x, "setUTCMilliseconds", 'The value of x is not "setUTCMilliseconds"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js
new file mode 100644
index 0000000000..dbaabc809e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js
@@ -0,0 +1,21 @@
+// 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 "setUTCMilliseconds" is 1
+esid: sec-date.prototype.setutcmilliseconds
+description: The "length" property of the "setUTCMilliseconds" is 1
+---*/
+assert.sameValue(
+ Date.prototype.setUTCMilliseconds.hasOwnProperty("length"),
+ true,
+ 'Date.prototype.setUTCMilliseconds.hasOwnProperty("length") must return true'
+);
+
+assert.sameValue(
+ Date.prototype.setUTCMilliseconds.length,
+ 1,
+ 'The value of Date.prototype.setUTCMilliseconds.length is expected to be 1'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js
new file mode 100644
index 0000000000..6345c92b26
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_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.setUTCMilliseconds property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking ReadOnly attribute
+includes: [propertyHelper.js]
+---*/
+
+var x = Date.prototype.setUTCMilliseconds.length;
+verifyNotWritable(Date.prototype.setUTCMilliseconds, "length", null, 1);
+
+assert.sameValue(
+ Date.prototype.setUTCMilliseconds.length,
+ x,
+ 'The value of Date.prototype.setUTCMilliseconds.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/setUTCMilliseconds/S15.9.5.29_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js
new file mode 100644
index 0000000000..7954d93fcd
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.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.setUTCMilliseconds property "length" has { ReadOnly, !
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking DontDelete attribute
+---*/
+assert.sameValue(
+ delete Date.prototype.setUTCMilliseconds.length,
+ true,
+ 'The value of `delete Date.prototype.setUTCMilliseconds.length` is expected to be true'
+);
+
+assert(
+ !Date.prototype.setUTCMilliseconds.hasOwnProperty('length'),
+ 'The value of !Date.prototype.setUTCMilliseconds.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/setUTCMilliseconds/S15.9.5.29_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js
new file mode 100644
index 0000000000..40071144d7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_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.setUTCMilliseconds property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcmilliseconds
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.setUTCMilliseconds.propertyIsEnumerable('length'),
+ 'The value of !Date.prototype.setUTCMilliseconds.propertyIsEnumerable(\'length\') is expected to be true'
+);
+
+for (var x in Date.prototype.setUTCMilliseconds) {
+ 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/setUTCMilliseconds/arg-coercion-order.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/arg-coercion-order.js
new file mode 100644
index 0000000000..02f2c3fd8a
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/arg-coercion-order.js
@@ -0,0 +1,32 @@
+// Copyright (C) 2021 Kevin Gibbons. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-date.prototype.setutcmilliseconds
+description: Order of coercion of provided argument vs NaN check
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+ 2. Let dt be ? ToNumber(date).
+ 3. If t is NaN, return NaN.
+ 4. Set t to LocalTime(t).
+ 5. Let newDate be MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), dt), TimeWithinDay(t)).
+ 6. Let u be TimeClip(UTC(newDate)).
+ 7. Set the [[DateValue]] internal slot of this Date object to u.
+ 8. Return u.
+---*/
+
+var date = new Date(NaN);
+var callCount = 0;
+var arg = {
+ valueOf: function() {
+ callCount += 1;
+ return 0;
+ }
+};
+
+var returnValue = date.setUTCMilliseconds(arg);
+
+assert.sameValue(callCount, 1, 'ToNumber invoked exactly once');
+assert.sameValue(returnValue, NaN, 'argument is ignored when `this` is an invalid date');
+assert.sameValue(date.getTime(), NaN, 'argument is ignored when `this` is an invalid date');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/browser.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/browser.js
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js
new file mode 100644
index 0000000000..65d0bd6f99
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/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.setutcmilliseconds
+description: >
+ Date.prototype.setUTCMilliseconds.name is "setUTCMilliseconds".
+info: |
+ Date.prototype.setUTCMilliseconds ( ms )
+
+ 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.setUTCMilliseconds.name, "setUTCMilliseconds");
+
+verifyNotEnumerable(Date.prototype.setUTCMilliseconds, "name");
+verifyNotWritable(Date.prototype.setUTCMilliseconds, "name");
+verifyConfigurable(Date.prototype.setUTCMilliseconds, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js
new file mode 100644
index 0000000000..a7e4cbcc7b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/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.setUTCMilliseconds 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.setUTCMilliseconds),
+ false,
+ 'isConstructor(Date.prototype.setUTCMilliseconds) must return false'
+);
+
+assert.throws(TypeError, () => {
+ let date = new Date(Date.now()); new date.setUTCMilliseconds();
+}, '`let date = new Date(Date.now()); new date.setUTCMilliseconds()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/shell.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/shell.js