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 --- .../toLocaleDateString/S15.9.5.6_A1_T1.js | 27 +++++++++++++++++ .../toLocaleDateString/S15.9.5.6_A1_T2.js | 24 +++++++++++++++ .../toLocaleDateString/S15.9.5.6_A1_T3.js | 22 ++++++++++++++ .../toLocaleDateString/S15.9.5.6_A2_T1.js | 21 +++++++++++++ .../toLocaleDateString/S15.9.5.6_A3_T1.js | 24 +++++++++++++++ .../toLocaleDateString/S15.9.5.6_A3_T2.js | 24 +++++++++++++++ .../toLocaleDateString/S15.9.5.6_A3_T3.js | 22 ++++++++++++++ .../Date/prototype/toLocaleDateString/browser.js | 0 .../Date/prototype/toLocaleDateString/name.js | 28 +++++++++++++++++ .../toLocaleDateString/not-a-constructor.js | 35 ++++++++++++++++++++++ .../Date/prototype/toLocaleDateString/shell.js | 0 11 files changed, 227 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/browser.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/shell.js (limited to 'js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString') diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js new file mode 100644 index 0000000000..4ecf0d3029 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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 "toLocaleDateString" has { DontEnum } + attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking absence of ReadOnly attribute +---*/ + +var x = Date.prototype.toLocaleDateString; +if (x === 1) { + Date.prototype.toLocaleDateString = 2; +} else { + Date.prototype.toLocaleDateString = 1; +} + +assert.notSameValue( + Date.prototype.toLocaleDateString, + x, + 'The value of Date.prototype.toLocaleDateString 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/toLocaleDateString/S15.9.5.6_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js new file mode 100644 index 0000000000..99ff7abca0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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 "toLocaleDateString" has { DontEnum } + attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking absence of DontDelete attribute +---*/ +assert.notSameValue( + delete Date.prototype.toLocaleDateString, + false, + 'The value of delete Date.prototype.toLocaleDateString is not false' +); + +assert( + !Date.prototype.hasOwnProperty('toLocaleDateString'), + 'The value of !Date.prototype.hasOwnProperty(\'toLocaleDateString\') is expected to be true' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js new file mode 100644 index 0000000000..20a586e47f --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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 "toLocaleDateString" has { DontEnum } + attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.propertyIsEnumerable('toLocaleDateString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toLocaleDateString\') is expected to be true' +); + +for (var x in Date.prototype) { + assert.notSameValue(x, "toLocaleDateString", 'The value of x is not "toLocaleDateString"'); +} + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js new file mode 100644 index 0000000000..283d863bf4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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 "toLocaleDateString" is 0 +esid: sec-date.prototype.tolocaledatestring +description: The "length" property of the "toLocaleDateString" is 0 +---*/ +assert.sameValue( + Date.prototype.toLocaleDateString.hasOwnProperty("length"), + true, + 'Date.prototype.toLocaleDateString.hasOwnProperty("length") must return true' +); + +assert.sameValue( + Date.prototype.toLocaleDateString.length, + 0, + 'The value of Date.prototype.toLocaleDateString.length is expected to be 0' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js new file mode 100644 index 0000000000..3df27ab673 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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.toLocaleDateString property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking ReadOnly attribute +includes: [propertyHelper.js] +---*/ + +var x = Date.prototype.toLocaleDateString.length; +verifyNotWritable(Date.prototype.toLocaleDateString, "length", null, 1); + +assert.sameValue( + Date.prototype.toLocaleDateString.length, + x, + 'The value of Date.prototype.toLocaleDateString.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/toLocaleDateString/S15.9.5.6_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js new file mode 100644 index 0000000000..5339b513a2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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.toLocaleDateString property "length" has { ReadOnly, ! + DontDelete, DontEnum } attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking DontDelete attribute +---*/ +assert.sameValue( + delete Date.prototype.toLocaleDateString.length, + true, + 'The value of `delete Date.prototype.toLocaleDateString.length` is expected to be true' +); + +assert( + !Date.prototype.toLocaleDateString.hasOwnProperty('length'), + 'The value of !Date.prototype.toLocaleDateString.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/toLocaleDateString/S15.9.5.6_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js new file mode 100644 index 0000000000..23f2fe919d --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_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.toLocaleDateString property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.tolocaledatestring +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.toLocaleDateString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toLocaleDateString.propertyIsEnumerable(\'length\') is expected to be true' +); + +for (var x in Date.prototype.toLocaleDateString) { + 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/toLocaleDateString/browser.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js new file mode 100644 index 0000000000..0f3981a565 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/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.tolocaledatestring +description: > + Date.prototype.toLocaleDateString.name is "toLocaleDateString". +info: | + Date.prototype.toLocaleDateString ( [ 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.toLocaleDateString.name, "toLocaleDateString"); + +verifyNotEnumerable(Date.prototype.toLocaleDateString, "name"); +verifyNotWritable(Date.prototype.toLocaleDateString, "name"); +verifyConfigurable(Date.prototype.toLocaleDateString, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js new file mode 100644 index 0000000000..45b56d70ed --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/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.toLocaleDateString 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.toLocaleDateString), + false, + 'isConstructor(Date.prototype.toLocaleDateString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toLocaleDateString(); +}, '`let date = new Date(Date.now()); new date.toLocaleDateString()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/shell.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3