summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes')
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js25
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js20
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js21
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js24
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js35
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/shell.js0
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js13
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-date.js36
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-object.js46
-rw-r--r--js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-valid-date.js52
15 files changed, 368 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js
new file mode 100644
index 0000000000..2f639c3cbb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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 "getUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking absence of ReadOnly attribute
+---*/
+
+var x = Date.prototype.getUTCMinutes;
+if (x === 1) {
+ Date.prototype.getUTCMinutes = 2;
+} else {
+ Date.prototype.getUTCMinutes = 1;
+}
+
+assert.notSameValue(
+ Date.prototype.getUTCMinutes,
+ x,
+ 'The value of Date.prototype.getUTCMinutes 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/getUTCMinutes/S15.9.5.21_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js
new file mode 100644
index 0000000000..c49b894496
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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 "getUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking absence of DontDelete attribute
+---*/
+assert.notSameValue(
+ delete Date.prototype.getUTCMinutes,
+ false,
+ 'The value of delete Date.prototype.getUTCMinutes is not false'
+);
+
+assert(
+ !Date.prototype.hasOwnProperty('getUTCMinutes'),
+ 'The value of !Date.prototype.hasOwnProperty(\'getUTCMinutes\') is expected to be true'
+);
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js
new file mode 100644
index 0000000000..3d5acebb83
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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 "getUTCMinutes" has { DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.propertyIsEnumerable('getUTCMinutes'),
+ 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCMinutes\') is expected to be true'
+);
+
+for (var x in Date.prototype) {
+ assert.notSameValue(x, "getUTCMinutes", 'The value of x is not "getUTCMinutes"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js
new file mode 100644
index 0000000000..0779033d4c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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 "getUTCMinutes" is 0
+esid: sec-date.prototype.getutcminutes
+description: The "length" property of the "getUTCMinutes" is 0
+---*/
+assert.sameValue(
+ Date.prototype.getUTCMinutes.hasOwnProperty("length"),
+ true,
+ 'Date.prototype.getUTCMinutes.hasOwnProperty("length") must return true'
+);
+
+assert.sameValue(
+ Date.prototype.getUTCMinutes.length,
+ 0,
+ 'The value of Date.prototype.getUTCMinutes.length is expected to be 0'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js
new file mode 100644
index 0000000000..4c43a77de8
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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.getUTCMinutes property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking ReadOnly attribute
+includes: [propertyHelper.js]
+---*/
+
+var x = Date.prototype.getUTCMinutes.length;
+verifyNotWritable(Date.prototype.getUTCMinutes, "length", null, 1);
+
+assert.sameValue(
+ Date.prototype.getUTCMinutes.length,
+ x,
+ 'The value of Date.prototype.getUTCMinutes.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/getUTCMinutes/S15.9.5.21_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js
new file mode 100644
index 0000000000..2c6a0ee7ee
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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.getUTCMinutes property "length" has { ReadOnly, !
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking DontDelete attribute
+---*/
+assert.sameValue(
+ delete Date.prototype.getUTCMinutes.length,
+ true,
+ 'The value of `delete Date.prototype.getUTCMinutes.length` is expected to be true'
+);
+
+assert(
+ !Date.prototype.getUTCMinutes.hasOwnProperty('length'),
+ 'The value of !Date.prototype.getUTCMinutes.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/getUTCMinutes/S15.9.5.21_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js
new file mode 100644
index 0000000000..fc9ed2a7fb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_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.getUTCMinutes property "length" has { ReadOnly,
+ DontDelete, DontEnum } attributes
+esid: sec-date.prototype.getutcminutes
+description: Checking DontEnum attribute
+---*/
+assert(
+ !Date.prototype.getUTCMinutes.propertyIsEnumerable('length'),
+ 'The value of !Date.prototype.getUTCMinutes.propertyIsEnumerable(\'length\') is expected to be true'
+);
+
+for (var x in Date.prototype.getUTCMinutes) {
+ 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/getUTCMinutes/browser.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/browser.js
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js
new file mode 100644
index 0000000000..5fc1ac7b8d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/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.getutcminutes
+description: >
+ Date.prototype.getUTCMinutes.name is "getUTCMinutes".
+info: |
+ Date.prototype.getUTCMinutes ( )
+
+ 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.getUTCMinutes.name, "getUTCMinutes");
+
+verifyNotEnumerable(Date.prototype.getUTCMinutes, "name");
+verifyNotWritable(Date.prototype.getUTCMinutes, "name");
+verifyConfigurable(Date.prototype.getUTCMinutes, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js
new file mode 100644
index 0000000000..be50d8d0e6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/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.getUTCMinutes 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.getUTCMinutes),
+ false,
+ 'isConstructor(Date.prototype.getUTCMinutes) must return false'
+);
+
+assert.throws(TypeError, () => {
+ let date = new Date(Date.now()); new date.getUTCMinutes();
+}, '`let date = new Date(Date.now()); new date.getUTCMinutes()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/shell.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/shell.js
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js
new file mode 100644
index 0000000000..71021ea4e1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-date.prototype.getutcminutes
+description: Return value for invalid date
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+ 2. If t is NaN, return NaN.
+---*/
+
+assert.sameValue(new Date(NaN).getUTCMinutes(), NaN);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-date.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-date.js
new file mode 100644
index 0000000000..aca3733e13
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-date.js
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-date.prototype.getutcminutes
+description: >
+ Behavior when "this" value is an Object without a [[DateValue]] internal slot
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+
+ The abstract operation thisTimeValue(value) performs the following steps:
+
+ 1. If Type(value) is Object and value has a [[DateValue]] internal slot, then
+ a. Return value.[[DateValue]].
+ 2. Throw a TypeError exception.
+---*/
+
+var getUTCMinutes = Date.prototype.getUTCMinutes;
+var args = (function() {
+ return arguments;
+}());
+
+assert.sameValue(typeof getUTCMinutes, 'function');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call({});
+}, 'ordinary object');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call([]);
+}, 'array exotic object');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(args);
+}, 'arguments exotic object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-object.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-object.js
new file mode 100644
index 0000000000..a39c1453ea
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-non-object.js
@@ -0,0 +1,46 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-date.prototype.getutcminutes
+description: Behavior when "this" value is not an Object
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+
+ The abstract operation thisTimeValue(value) performs the following steps:
+
+ 1. If Type(value) is Object and value has a [[DateValue]] internal slot, then
+ a. Return value.[[DateValue]].
+ 2. Throw a TypeError exception.
+features: [Symbol]
+---*/
+
+var getUTCMinutes = Date.prototype.getUTCMinutes;
+var symbol = Symbol();
+
+assert.sameValue(typeof getUTCMinutes, 'function');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(0);
+}, 'number');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(true);
+}, 'boolean');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(null);
+}, 'null');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(undefined);
+}, 'undefined');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call('');
+}, 'string');
+
+assert.throws(TypeError, function() {
+ getUTCMinutes.call(symbol);
+}, 'symbol');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-valid-date.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-valid-date.js
new file mode 100644
index 0000000000..04792ccc2b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/this-value-valid-date.js
@@ -0,0 +1,52 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-date.prototype.getutcminutes
+description: Return value for valid dates
+info: |
+ 1. Let t be ? thisTimeValue(this value).
+ 2. If t is NaN, return NaN.
+ 3. Return MinFromTime(t).
+---*/
+
+var threeTwentyTwo = 1467818520000;
+var threeFiftyNine = 1467820740000;
+var minMs = 60 * 1000;
+
+assert.sameValue(
+ new Date(threeTwentyTwo).getUTCMinutes(), 22, 'first millisecond'
+);
+assert.sameValue(
+ new Date(threeTwentyTwo - 1).getUTCMinutes(), 21, 'previous millisecond'
+);
+assert.sameValue(
+ new Date(threeTwentyTwo + minMs - 1).getUTCMinutes(), 22, 'final millisecond'
+);
+assert.sameValue(
+ new Date(threeTwentyTwo + minMs).getUTCMinutes(),
+ 23,
+ 'subsequent millisecond'
+);
+
+assert.sameValue(
+ new Date(threeFiftyNine).getUTCMinutes(),
+ 59,
+ 'first millisecond (day boundary)'
+);
+assert.sameValue(
+ new Date(threeFiftyNine - 1).getUTCMinutes(),
+ 58,
+ 'previous millisecond (day boundary)'
+);
+assert.sameValue(
+ new Date(threeFiftyNine + minMs - 1).getUTCMinutes(),
+ 59,
+ 'final millisecond (day boundary)'
+);
+assert.sameValue(
+ new Date(threeFiftyNine + minMs).getUTCMinutes(),
+ 0,
+ 'subsequent millisecond (day boundary)'
+);
+
+reportCompare(0, 0);