summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes')
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js25
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js20
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js21
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/arg-coercion-order.js50
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js35
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/shell.js0
12 files changed, 271 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js
new file mode 100644
index 0000000000..d2aa63596b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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 "setUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking absence of ReadOnly attribute
+---*/
+
+var x = Date.prototype.setUTCMinutes;
+if (x === 1) {
+ Date.prototype.setUTCMinutes = 2;
+} else {
+ Date.prototype.setUTCMinutes = 1;
+}
+
+assert.notSameValue(
+ Date.prototype.setUTCMinutes,
+ x,
+ 'The value of Date.prototype.setUTCMinutes 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/setUTCMinutes/S15.9.5.33_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js
new file mode 100644
index 0000000000..14f6fa9b8f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.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 "setUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking absence of DontDelete attribute
+---*/
+assert.notSameValue(
+ delete Date.prototype.setUTCMinutes,
+ false,
+ 'The value of delete Date.prototype.setUTCMinutes is not false'
+);
+
+assert(
+ !Date.prototype.hasOwnProperty('setUTCMinutes'),
+ 'The value of !Date.prototype.hasOwnProperty(\'setUTCMinutes\') is expected to be true'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js
new file mode 100644
index 0000000000..0a3afc4f3f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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 "setUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.propertyIsEnumerable('setUTCMinutes'),
+ 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMinutes\') is expected to be true'
+);
+
+for (var x in Date.prototype) {
+ assert.notSameValue(x, "setUTCMinutes", 'The value of x is not "setUTCMinutes"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js
new file mode 100644
index 0000000000..62c01ca4b7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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 "setUTCMinutes" is 3
+esid: sec-date.prototype.setutcminutes
+description: The "length" property of the "setUTCMinutes" is 3
+---*/
+assert.sameValue(
+ Date.prototype.setUTCMinutes.hasOwnProperty("length"),
+ true,
+ 'Date.prototype.setUTCMinutes.hasOwnProperty("length") must return true'
+);
+
+assert.sameValue(
+ Date.prototype.setUTCMinutes.length,
+ 3,
+ 'The value of Date.prototype.setUTCMinutes.length is expected to be 3'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js
new file mode 100644
index 0000000000..ca46350d6b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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.setUTCMinutes property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking ReadOnly attribute
+includes: [propertyHelper.js]
+---*/
+
+var x = Date.prototype.setUTCMinutes.length;
+verifyNotWritable(Date.prototype.setUTCMinutes, "length", null, 1);
+
+assert.sameValue(
+ Date.prototype.setUTCMinutes.length,
+ x,
+ 'The value of Date.prototype.setUTCMinutes.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/setUTCMinutes/S15.9.5.33_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js
new file mode 100644
index 0000000000..de0271b5b5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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.setUTCMinutes property "length" has { ReadOnly, !
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking DontDelete attribute
+---*/
+assert.sameValue(
+ delete Date.prototype.setUTCMinutes.length,
+ true,
+ 'The value of `delete Date.prototype.setUTCMinutes.length` is expected to be true'
+);
+
+assert(
+ !Date.prototype.setUTCMinutes.hasOwnProperty('length'),
+ 'The value of !Date.prototype.setUTCMinutes.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/setUTCMinutes/S15.9.5.33_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js
new file mode 100644
index 0000000000..57301fe91f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_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.setUTCMinutes property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.setutcminutes
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.setUTCMinutes.propertyIsEnumerable('length'),
+ 'The value of !Date.prototype.setUTCMinutes.propertyIsEnumerable(\'length\') is expected to be true'
+);
+
+for (var x in Date.prototype.setUTCMinutes) {
+ 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/setUTCMinutes/arg-coercion-order.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/arg-coercion-order.js
new file mode 100644
index 0000000000..83b0a0346d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/arg-coercion-order.js
@@ -0,0 +1,50 @@
+// 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.setutcminutes
+description: Order of coercion of provided argument vs NaN check
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+ 2. Let m be ? ToNumber(min).
+ 3. If sec is present, let s be ? ToNumber(sec).
+ 4. If ms is present, let milli be ? ToNumber(ms).
+ 5. If t is NaN, return NaN.
+ 6. If sec is not present, let s be SecFromTime(t).
+ 7. If ms is not present, let milli be msFromTime(t).
+ 8. Let date be MakeDate(Day(t), MakeTime(HourFromTime(t), m, s, milli)).
+ 9. Let v be TimeClip(date).
+ 10. Set the [[DateValue]] internal slot of this Date object to v.
+ 11. Return v.
+includes: [compareArray.js]
+---*/
+
+var date = new Date(NaN);
+var effects = [];
+var argMin = {
+ valueOf: function() {
+ effects.push('valueOf min');
+ return 0;
+ }
+};
+var argSec = {
+ valueOf: function() {
+ effects.push('valueOf sec');
+ return 0;
+ }
+};
+var argMs = {
+ valueOf: function() {
+ effects.push('valueOf ms');
+ return 0;
+ }
+};
+
+var returnValue = date.setUTCMinutes(argMin, argSec, argMs);
+
+var expectedEffects = ['valueOf min', 'valueOf sec', 'valueOf ms'];
+
+assert.compareArray(effects, expectedEffects);
+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/setUTCMinutes/browser.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/browser.js
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js
new file mode 100644
index 0000000000..db16d42c80
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/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.setutcminutes
+description: >
+ Date.prototype.setUTCMinutes.name is "setUTCMinutes".
+info: |
+ Date.prototype.setUTCMinutes ( min [ , sec [, 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.setUTCMinutes.name, "setUTCMinutes");
+
+verifyNotEnumerable(Date.prototype.setUTCMinutes, "name");
+verifyNotWritable(Date.prototype.setUTCMinutes, "name");
+verifyConfigurable(Date.prototype.setUTCMinutes, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js
new file mode 100644
index 0000000000..01f6a9293f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/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.setUTCMinutes 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.setUTCMinutes),
+ false,
+ 'isConstructor(Date.prototype.setUTCMinutes) must return false'
+);
+
+assert.throws(TypeError, () => {
+ let date = new Date(Date.now()); new date.setUTCMinutes();
+}, '`let date = new Date(Date.now()); new date.setUTCMinutes()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/shell.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/shell.js