From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js | 25 +++++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js | 22 ++++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js | 20 +++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js | 21 +++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js | 24 +++++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js | 24 +++++++++++++ .../Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js | 22 ++++++++++++ .../prototype/setUTCMonth/arg-coercion-order.js | 42 ++++++++++++++++++++++ .../Date/prototype/setUTCMonth/browser.js | 0 .../built-ins/Date/prototype/setUTCMonth/name.js | 28 +++++++++++++++ .../prototype/setUTCMonth/not-a-constructor.js | 35 ++++++++++++++++++ .../built-ins/Date/prototype/setUTCMonth/shell.js | 0 12 files changed, 263 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/arg-coercion-order.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/browser.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/shell.js (limited to 'js/src/tests/test262/built-ins/Date/prototype/setUTCMonth') diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js new file mode 100644 index 0000000000..3a47d37da5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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 "setUTCMonth" has { DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking absence of ReadOnly attribute +---*/ + +var x = Date.prototype.setUTCMonth; +if (x === 1) { + Date.prototype.setUTCMonth = 2; +} else { + Date.prototype.setUTCMonth = 1; +} + +assert.notSameValue( + Date.prototype.setUTCMonth, + x, + 'The value of Date.prototype.setUTCMonth 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/setUTCMonth/S15.9.5.39_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js new file mode 100644 index 0000000000..e250febbfe --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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 "setUTCMonth" has { DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking absence of DontDelete attribute +---*/ +assert.notSameValue( + delete Date.prototype.setUTCMonth, + false, + 'The value of delete Date.prototype.setUTCMonth is not false' +); + +assert( + !Date.prototype.hasOwnProperty('setUTCMonth'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCMonth\') is expected to be true' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js new file mode 100644 index 0000000000..bf3154fab4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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 "setUTCMonth" has { DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.propertyIsEnumerable('setUTCMonth'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMonth\') is expected to be true' +); + +for (var x in Date.prototype) { + assert.notSameValue(x, "setUTCMonth", 'The value of x is not "setUTCMonth"'); +} + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js new file mode 100644 index 0000000000..e917ba9810 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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 "setUTCMonth" is 2 +esid: sec-date.prototype.setutcmonth +description: The "length" property of the "setUTCMonth" is 2 +---*/ +assert.sameValue( + Date.prototype.setUTCMonth.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCMonth.hasOwnProperty("length") must return true' +); + +assert.sameValue( + Date.prototype.setUTCMonth.length, + 2, + 'The value of Date.prototype.setUTCMonth.length is expected to be 2' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js new file mode 100644 index 0000000000..cf63985f95 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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.setUTCMonth property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking ReadOnly attribute +includes: [propertyHelper.js] +---*/ + +var x = Date.prototype.setUTCMonth.length; +verifyNotWritable(Date.prototype.setUTCMonth, "length", null, 1); + +assert.sameValue( + Date.prototype.setUTCMonth.length, + x, + 'The value of Date.prototype.setUTCMonth.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/setUTCMonth/S15.9.5.39_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js new file mode 100644 index 0000000000..923cba2989 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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.setUTCMonth property "length" has { ReadOnly, ! + DontDelete, DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking DontDelete attribute +---*/ +assert.sameValue( + delete Date.prototype.setUTCMonth.length, + true, + 'The value of `delete Date.prototype.setUTCMonth.length` is expected to be true' +); + +assert( + !Date.prototype.setUTCMonth.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCMonth.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/setUTCMonth/S15.9.5.39_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js new file mode 100644 index 0000000000..03d107db9b --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_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.setUTCMonth property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.setutcmonth +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.setUTCMonth.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCMonth.propertyIsEnumerable(\'length\') is expected to be true' +); + +for (var x in Date.prototype.setUTCMonth) { + 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/setUTCMonth/arg-coercion-order.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/arg-coercion-order.js new file mode 100644 index 0000000000..c94d09f56d --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/arg-coercion-order.js @@ -0,0 +1,42 @@ +// 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.setutcmonth +description: Order of coercion of provided argument vs NaN check +info: | + 1. Let t be ? thisTimeValue(this value). + 2. Let m be ? ToNumber(month). + 3. If date is present, let dt be ? ToNumber(date). + 4. If t is NaN, return NaN. + 5. If date is not present, let dt be DateFromTime(t). + 6. Let newDate be MakeDate(MakeDay(YearFromTime(t), m, dt), TimeWithinDay(t)). + 7. Let v be TimeClip(newDate). + 8. Set the [[DateValue]] internal slot of this Date object to v. + 9. Return v. +includes: [compareArray.js] +---*/ + +var date = new Date(NaN); +var effects = []; +var argMonth = { + valueOf: function() { + effects.push('valueOf month'); + return 0; + } +}; +var argDate = { + valueOf: function() { + effects.push('valueOf date'); + return 0; + } +}; + +var returnValue = date.setUTCMonth(argMonth, argDate); + +var expectedEffects = ['valueOf month', 'valueOf date']; + +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/setUTCMonth/browser.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js new file mode 100644 index 0000000000..70ca8822ea --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/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.setutcmonth +description: > + Date.prototype.setUTCMonth.name is "setUTCMonth". +info: | + Date.prototype.setUTCMonth ( month [ , date ] ) + + 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.setUTCMonth.name, "setUTCMonth"); + +verifyNotEnumerable(Date.prototype.setUTCMonth, "name"); +verifyNotWritable(Date.prototype.setUTCMonth, "name"); +verifyConfigurable(Date.prototype.setUTCMonth, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js new file mode 100644 index 0000000000..977faba6d2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/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.setUTCMonth 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.setUTCMonth), + false, + 'isConstructor(Date.prototype.setUTCMonth) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCMonth(); +}, '`let date = new Date(Date.now()); new date.setUTCMonth()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/shell.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3