mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Update built-ins/Date/prototype/getXXX to verifyProperty
This commit is contained in:
parent
800d2190b3
commit
d1c2a6f139
@ -1,23 +0,0 @@
|
||||
// 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 "getDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getDate;
|
||||
if (x === 1) {
|
||||
Date.prototype.getDate = 2;
|
||||
} else {
|
||||
Date.prototype.getDate = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getDate,
|
||||
x,
|
||||
'The value of Date.prototype.getDate is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,16 +0,0 @@
|
||||
// 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 "getDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(delete Date.prototype.getDate, false, 'The value of delete Date.prototype.getDate is not false');
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getDate'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getDate\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,18 +0,0 @@
|
||||
// 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 "getDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getDate'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getDate\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getDate", 'The value of x is not "getDate"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,15 +0,0 @@
|
||||
// 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 "getDate" is 0
|
||||
esid: sec-date.prototype.getdate
|
||||
description: The "length" property of the "getDate" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getDate.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getDate.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(Date.prototype.getDate.length, 0, 'The value of Date.prototype.getDate.length is expected to be 0');
|
@ -1,22 +0,0 @@
|
||||
// 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.getDate property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getDate.length;
|
||||
verifyNotWritable(Date.prototype.getDate, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getDate.length,
|
||||
x,
|
||||
'The value of Date.prototype.getDate.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getDate property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getDate.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getDate.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getDate.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getDate.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getDate property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getdate
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getDate.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getDate.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getDate) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getDate/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getDate/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getdate
|
||||
description: >
|
||||
Date.prototype.getDate.length is 0.
|
||||
info: |
|
||||
Date.prototype.getDate ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getDate, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getDate/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getDate/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getdate
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getDate.
|
||||
info: |
|
||||
Date.prototype.getDate ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getDate", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: The Date.prototype property "getDay" has { DontEnum } attributes
|
||||
es5id: 15.9.5.16_A1_T1
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getDay;
|
||||
if (x === 1) {
|
||||
Date.prototype.getDay = 2;
|
||||
} else {
|
||||
Date.prototype.getDay = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getDay,
|
||||
x,
|
||||
'The value of Date.prototype.getDay is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,17 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: The Date.prototype property "getDay" has { DontEnum } attributes
|
||||
es5id: 15.9.5.16_A1_T2
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(delete Date.prototype.getDay, false, 'The value of delete Date.prototype.getDay is not false');
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getDay'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getDay\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: The Date.prototype property "getDay" has { DontEnum } attributes
|
||||
es5id: 15.9.5.16_A1_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getDay'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getDay\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getDay", 'The value of x is not "getDay"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,16 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: The "length" property of the "getDay" is 0
|
||||
es5id: 15.9.5.16_A2_T1
|
||||
description: The "length" property of the "getDay" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getDay.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getDay.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(Date.prototype.getDay.length, 0, 'The value of Date.prototype.getDay.length is expected to be 0');
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: |
|
||||
The Date.prototype.getDay property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
es5id: 15.9.5.16_A3_T1
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getDay.length;
|
||||
verifyNotWritable(Date.prototype.getDay, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getDay.length,
|
||||
x,
|
||||
'The value of Date.prototype.getDay.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: |
|
||||
The Date.prototype.getDay property "length" has { ReadOnly, ! DontDelete,
|
||||
DontEnum } attributes
|
||||
es5id: 15.9.5.16_A3_T2
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getDay.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getDay.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getDay.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getDay.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
info: |
|
||||
The Date.prototype.getDay property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
es5id: 15.9.5.16_A3_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getDay.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getDay.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getDay) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getDay/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getDay/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
description: >
|
||||
Date.prototype.getDay.length is 0.
|
||||
info: |
|
||||
Date.prototype.getDay ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getDay, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getDay/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getDay/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getday
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getDay.
|
||||
info: |
|
||||
Date.prototype.getDay ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getDay", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: The Date.prototype property "getFullYear" has { DontEnum } attributes
|
||||
es5id: 15.9.5.10_A1_T1
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getFullYear;
|
||||
if (x === 1) {
|
||||
Date.prototype.getFullYear = 2;
|
||||
} else {
|
||||
Date.prototype.getFullYear = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getFullYear,
|
||||
x,
|
||||
'The value of Date.prototype.getFullYear is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: The Date.prototype property "getFullYear" has { DontEnum } attributes
|
||||
es5id: 15.9.5.10_A1_T2
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getFullYear,
|
||||
false,
|
||||
'The value of delete Date.prototype.getFullYear is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getFullYear'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getFullYear\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: The Date.prototype property "getFullYear" has { DontEnum } attributes
|
||||
es5id: 15.9.5.10_A1_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getFullYear'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getFullYear\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getFullYear", 'The value of x is not "getFullYear"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: The "length" property of the "getFullYear" is 0
|
||||
es5id: 15.9.5.10_A2_T1
|
||||
description: The "length" property of the "getFullYear" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getFullYear.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getFullYear.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getFullYear.length,
|
||||
0,
|
||||
'The value of Date.prototype.getFullYear.length is expected to be 0'
|
||||
);
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: |
|
||||
The Date.prototype.getFullYear property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.10_A3_T1
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getFullYear.length;
|
||||
verifyNotWritable(Date.prototype.getFullYear, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getFullYear.length,
|
||||
x,
|
||||
'The value of Date.prototype.getFullYear.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: |
|
||||
The Date.prototype.getFullYear property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.10_A3_T2
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getFullYear.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getFullYear.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getFullYear.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getFullYear.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
info: |
|
||||
The Date.prototype.getFullYear property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.10_A3_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getFullYear.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getFullYear.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getFullYear) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getFullYear/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getFullYear/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
description: >
|
||||
Date.prototype.getFullYear.length is 0.
|
||||
info: |
|
||||
Date.prototype.getFullYear ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getFullYear, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getFullYear/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getFullYear/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getfullyear
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getFullYear.
|
||||
info: |
|
||||
Date.prototype.getFullYear ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getFullYear", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: The Date.prototype property "getHours" has { DontEnum } attributes
|
||||
es5id: 15.9.5.18_A1_T1
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getHours;
|
||||
if (x === 1) {
|
||||
Date.prototype.getHours = 2;
|
||||
} else {
|
||||
Date.prototype.getHours = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getHours,
|
||||
x,
|
||||
'The value of Date.prototype.getHours is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,17 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: The Date.prototype property "getHours" has { DontEnum } attributes
|
||||
es5id: 15.9.5.18_A1_T2
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(delete Date.prototype.getHours, false, 'The value of delete Date.prototype.getHours is not false');
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getHours'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getHours\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: The Date.prototype property "getHours" has { DontEnum } attributes
|
||||
es5id: 15.9.5.18_A1_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getHours'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getHours\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getHours", 'The value of x is not "getHours"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,16 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: The "length" property of the "getHours" is 0
|
||||
es5id: 15.9.5.18_A2_T1
|
||||
description: The "length" property of the "getHours" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getHours.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getHours.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(Date.prototype.getHours.length, 0, 'The value of Date.prototype.getHours.length is expected to be 0');
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: |
|
||||
The Date.prototype.getHours property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
es5id: 15.9.5.18_A3_T1
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getHours.length;
|
||||
verifyNotWritable(Date.prototype.getHours, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getHours.length,
|
||||
x,
|
||||
'The value of Date.prototype.getHours.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: |
|
||||
The Date.prototype.getHours property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.18_A3_T2
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getHours.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getHours.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getHours.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getHours.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
info: |
|
||||
The Date.prototype.getHours property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
es5id: 15.9.5.18_A3_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getHours.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getHours.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getHours) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getHours/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getHours/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
description: >
|
||||
Date.prototype.getHours.length is 0.
|
||||
info: |
|
||||
Date.prototype.getHours ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getHours, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getHours/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getHours/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gethours
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getHours.
|
||||
info: |
|
||||
Date.prototype.getHours ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getHours", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: The Date.prototype property "getMilliseconds" has { DontEnum } attributes
|
||||
es5id: 15.9.5.24_A1_T1
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMilliseconds;
|
||||
if (x === 1) {
|
||||
Date.prototype.getMilliseconds = 2;
|
||||
} else {
|
||||
Date.prototype.getMilliseconds = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getMilliseconds,
|
||||
x,
|
||||
'The value of Date.prototype.getMilliseconds is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: The Date.prototype property "getMilliseconds" has { DontEnum } attributes
|
||||
es5id: 15.9.5.24_A1_T2
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getMilliseconds,
|
||||
false,
|
||||
'The value of delete Date.prototype.getMilliseconds is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getMilliseconds'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getMilliseconds\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: The Date.prototype property "getMilliseconds" has { DontEnum } attributes
|
||||
es5id: 15.9.5.24_A1_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getMilliseconds'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getMilliseconds\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getMilliseconds", 'The value of x is not "getMilliseconds"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: The "length" property of the "getMilliseconds" is 0
|
||||
es5id: 15.9.5.24_A2_T1
|
||||
description: The "length" property of the "getMilliseconds" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getMilliseconds.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getMilliseconds.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getMilliseconds.length,
|
||||
0,
|
||||
'The value of Date.prototype.getMilliseconds.length is expected to be 0'
|
||||
);
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: |
|
||||
The Date.prototype.getMilliseconds property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.24_A3_T1
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMilliseconds.length;
|
||||
verifyNotWritable(Date.prototype.getMilliseconds, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getMilliseconds.length,
|
||||
x,
|
||||
'The value of Date.prototype.getMilliseconds.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: |
|
||||
The Date.prototype.getMilliseconds property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.24_A3_T2
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getMilliseconds.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getMilliseconds.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getMilliseconds.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getMilliseconds.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
info: |
|
||||
The Date.prototype.getMilliseconds property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.24_A3_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getMilliseconds.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getMilliseconds.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getMilliseconds) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getMilliseconds/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getMilliseconds/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
description: >
|
||||
Date.prototype.getMilliseconds.length is 0.
|
||||
info: |
|
||||
Date.prototype.getMilliseconds ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getMilliseconds, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getMilliseconds/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getMilliseconds/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmilliseconds
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getMilliseconds.
|
||||
info: |
|
||||
Date.prototype.getMilliseconds ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getMilliseconds", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: The Date.prototype property "getMinutes" has { DontEnum } attributes
|
||||
es5id: 15.9.5.20_A1_T1
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMinutes;
|
||||
if (x === 1) {
|
||||
Date.prototype.getMinutes = 2;
|
||||
} else {
|
||||
Date.prototype.getMinutes = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getMinutes,
|
||||
x,
|
||||
'The value of Date.prototype.getMinutes is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: The Date.prototype property "getMinutes" has { DontEnum } attributes
|
||||
es5id: 15.9.5.20_A1_T2
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getMinutes,
|
||||
false,
|
||||
'The value of delete Date.prototype.getMinutes is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getMinutes'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getMinutes\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: The Date.prototype property "getMinutes" has { DontEnum } attributes
|
||||
es5id: 15.9.5.20_A1_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getMinutes'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getMinutes\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getMinutes", 'The value of x is not "getMinutes"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: The "length" property of the "getMinutes" is 0
|
||||
es5id: 15.9.5.20_A2_T1
|
||||
description: The "length" property of the "getMinutes" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getMinutes.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getMinutes.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getMinutes.length,
|
||||
0,
|
||||
'The value of Date.prototype.getMinutes.length is expected to be 0'
|
||||
);
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: |
|
||||
The Date.prototype.getMinutes property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.20_A3_T1
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMinutes.length;
|
||||
verifyNotWritable(Date.prototype.getMinutes, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getMinutes.length,
|
||||
x,
|
||||
'The value of Date.prototype.getMinutes.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: |
|
||||
The Date.prototype.getMinutes property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.20_A3_T2
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getMinutes.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getMinutes.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getMinutes.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getMinutes.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,21 +0,0 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
info: |
|
||||
The Date.prototype.getMinutes property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
es5id: 15.9.5.20_A3_T3
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getMinutes.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getMinutes.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getMinutes) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getMinutes/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getMinutes/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
description: >
|
||||
Date.prototype.getMinutes.length is 0.
|
||||
info: |
|
||||
Date.prototype.getMinutes ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getMinutes, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getMinutes/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getMinutes/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getminutes
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getMinutes.
|
||||
info: |
|
||||
Date.prototype.getMinutes ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getMinutes", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
// 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 "getMonth" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMonth;
|
||||
if (x === 1) {
|
||||
Date.prototype.getMonth = 2;
|
||||
} else {
|
||||
Date.prototype.getMonth = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getMonth,
|
||||
x,
|
||||
'The value of Date.prototype.getMonth is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,16 +0,0 @@
|
||||
// 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 "getMonth" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(delete Date.prototype.getMonth, false, 'The value of delete Date.prototype.getMonth is not false');
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getMonth'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getMonth\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,18 +0,0 @@
|
||||
// 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 "getMonth" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getMonth'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getMonth\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getMonth", 'The value of x is not "getMonth"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,15 +0,0 @@
|
||||
// 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 "getMonth" is 0
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: The "length" property of the "getMonth" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getMonth.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getMonth.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(Date.prototype.getMonth.length, 0, 'The value of Date.prototype.getMonth.length is expected to be 0');
|
@ -1,22 +0,0 @@
|
||||
// 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.getMonth property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getMonth.length;
|
||||
verifyNotWritable(Date.prototype.getMonth, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getMonth.length,
|
||||
x,
|
||||
'The value of Date.prototype.getMonth.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getMonth property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getMonth.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getMonth.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getMonth.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getMonth.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getMonth property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getMonth.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getMonth.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getMonth) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getMonth/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getMonth/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: >
|
||||
Date.prototype.getMonth.length is 0.
|
||||
info: |
|
||||
Date.prototype.getMonth ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getMonth, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getMonth/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getMonth/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getmonth
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getMonth.
|
||||
info: |
|
||||
Date.prototype.getMonth ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getMonth", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
// 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 "getSeconds" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getSeconds;
|
||||
if (x === 1) {
|
||||
Date.prototype.getSeconds = 2;
|
||||
} else {
|
||||
Date.prototype.getSeconds = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getSeconds,
|
||||
x,
|
||||
'The value of Date.prototype.getSeconds is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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 "getSeconds" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getSeconds,
|
||||
false,
|
||||
'The value of delete Date.prototype.getSeconds is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getSeconds'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getSeconds\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,18 +0,0 @@
|
||||
// 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 "getSeconds" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getSeconds'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getSeconds\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getSeconds", 'The value of x is not "getSeconds"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// 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 "getSeconds" is 0
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: The "length" property of the "getSeconds" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getSeconds.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getSeconds.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getSeconds.length,
|
||||
0,
|
||||
'The value of Date.prototype.getSeconds.length is expected to be 0'
|
||||
);
|
@ -1,22 +0,0 @@
|
||||
// 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.getSeconds property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getSeconds.length;
|
||||
verifyNotWritable(Date.prototype.getSeconds, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getSeconds.length,
|
||||
x,
|
||||
'The value of Date.prototype.getSeconds.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getSeconds property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getSeconds.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getSeconds.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getSeconds.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getSeconds.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getSeconds property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getSeconds.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getSeconds.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getSeconds) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getSeconds/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getSeconds/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: >
|
||||
Date.prototype.getSeconds.length is 0.
|
||||
info: |
|
||||
Date.prototype.getSeconds ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getSeconds, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getSeconds/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getSeconds/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getSeconds.
|
||||
info: |
|
||||
Date.prototype.getSeconds ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getSeconds", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
// 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 "getTime" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getTime;
|
||||
if (x === 1) {
|
||||
Date.prototype.getTime = 2;
|
||||
} else {
|
||||
Date.prototype.getTime = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getTime,
|
||||
x,
|
||||
'The value of Date.prototype.getTime is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,16 +0,0 @@
|
||||
// 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 "getTime" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(delete Date.prototype.getTime, false, 'The value of delete Date.prototype.getTime is not false');
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getTime'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getTime\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,18 +0,0 @@
|
||||
// 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 "getTime" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getTime'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getTime\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getTime", 'The value of x is not "getTime"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,15 +0,0 @@
|
||||
// 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 "getTime" is 0
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: The "length" property of the "getTime" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getTime.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getTime.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(Date.prototype.getTime.length, 0, 'The value of Date.prototype.getTime.length is expected to be 0');
|
@ -1,22 +0,0 @@
|
||||
// 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.getTime property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getTime.length;
|
||||
verifyNotWritable(Date.prototype.getTime, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getTime.length,
|
||||
x,
|
||||
'The value of Date.prototype.getTime.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getTime property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getTime.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getTime.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getTime.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getTime.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getTime property "length" has { ReadOnly, DontDelete,
|
||||
DontEnum } attributes
|
||||
esid: sec-date.prototype.getseconds
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getTime.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getTime.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getTime) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getTime/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getTime/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gettime
|
||||
description: >
|
||||
Date.prototype.getTime.length is 0.
|
||||
info: |
|
||||
Date.prototype.getTime ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getTime, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getTime/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getTime/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gettime
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getTime.
|
||||
info: |
|
||||
Date.prototype.getTime ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getTime", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,25 +0,0 @@
|
||||
// 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 "getTimezoneOffset" has { DontEnum }
|
||||
attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getTimezoneOffset;
|
||||
if (x === 1) {
|
||||
Date.prototype.getTimezoneOffset = 2;
|
||||
} else {
|
||||
Date.prototype.getTimezoneOffset = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getTimezoneOffset,
|
||||
x,
|
||||
'The value of Date.prototype.getTimezoneOffset is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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 "getTimezoneOffset" has { DontEnum }
|
||||
attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getTimezoneOffset,
|
||||
false,
|
||||
'The value of delete Date.prototype.getTimezoneOffset is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getTimezoneOffset'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getTimezoneOffset\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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 "getTimezoneOffset" has { DontEnum }
|
||||
attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getTimezoneOffset'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getTimezoneOffset\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getTimezoneOffset", 'The value of x is not "getTimezoneOffset"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// 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 "getTimezoneOffset" is 0
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: The "length" property of the "getTimezoneOffset" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getTimezoneOffset.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getTimezoneOffset.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getTimezoneOffset.length,
|
||||
0,
|
||||
'The value of Date.prototype.getTimezoneOffset.length is expected to be 0'
|
||||
);
|
@ -1,22 +0,0 @@
|
||||
// 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.getTimezoneOffset property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getTimezoneOffset.length;
|
||||
verifyNotWritable(Date.prototype.getTimezoneOffset, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getTimezoneOffset.length,
|
||||
x,
|
||||
'The value of Date.prototype.getTimezoneOffset.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getTimezoneOffset property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getTimezoneOffset.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getTimezoneOffset.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getTimezoneOffset.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getTimezoneOffset.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getTimezoneOffset property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getTimezoneOffset.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getTimezoneOffset.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getTimezoneOffset) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getTimezoneOffset/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getTimezoneOffset/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: >
|
||||
Date.prototype.getTimezoneOffset.length is 0.
|
||||
info: |
|
||||
Date.prototype.getTimezoneOffset ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getTimezoneOffset, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getTimezoneOffset/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getTimezoneOffset/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.gettimezoneoffset
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getTimezoneOffset.
|
||||
info: |
|
||||
Date.prototype.getTimezoneOffset ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getTimezoneOffset", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
// 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 "getUTCDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getUTCDate;
|
||||
if (x === 1) {
|
||||
Date.prototype.getUTCDate = 2;
|
||||
} else {
|
||||
Date.prototype.getUTCDate = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getUTCDate,
|
||||
x,
|
||||
'The value of Date.prototype.getUTCDate is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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 "getUTCDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking absence of DontDelete attribute
|
||||
---*/
|
||||
assert.notSameValue(
|
||||
delete Date.prototype.getUTCDate,
|
||||
false,
|
||||
'The value of delete Date.prototype.getUTCDate is not false'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.hasOwnProperty('getUTCDate'),
|
||||
'The value of !Date.prototype.hasOwnProperty(\'getUTCDate\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,18 +0,0 @@
|
||||
// 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 "getUTCDate" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.propertyIsEnumerable('getUTCDate'),
|
||||
'The value of !Date.prototype.propertyIsEnumerable(\'getUTCDate\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype) {
|
||||
assert.notSameValue(x, "getUTCDate", 'The value of x is not "getUTCDate"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,19 +0,0 @@
|
||||
// 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 "getUTCDate" is 0
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: The "length" property of the "getUTCDate" is 0
|
||||
---*/
|
||||
assert.sameValue(
|
||||
Date.prototype.getUTCDate.hasOwnProperty("length"),
|
||||
true,
|
||||
'Date.prototype.getUTCDate.hasOwnProperty("length") must return true'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getUTCDate.length,
|
||||
0,
|
||||
'The value of Date.prototype.getUTCDate.length is expected to be 0'
|
||||
);
|
@ -1,22 +0,0 @@
|
||||
// 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.getUTCDate property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking ReadOnly attribute
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getUTCDate.length;
|
||||
verifyNotWritable(Date.prototype.getUTCDate, "length", null, 1);
|
||||
|
||||
assert.sameValue(
|
||||
Date.prototype.getUTCDate.length,
|
||||
x,
|
||||
'The value of Date.prototype.getUTCDate.length is expected to equal the value of x'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,22 +0,0 @@
|
||||
// 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.getUTCDate property "length" has { ReadOnly, !
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking DontDelete attribute
|
||||
---*/
|
||||
assert.sameValue(
|
||||
delete Date.prototype.getUTCDate.length,
|
||||
true,
|
||||
'The value of `delete Date.prototype.getUTCDate.length` is expected to be true'
|
||||
);
|
||||
|
||||
assert(
|
||||
!Date.prototype.getUTCDate.hasOwnProperty('length'),
|
||||
'The value of !Date.prototype.getUTCDate.hasOwnProperty(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
@ -1,20 +0,0 @@
|
||||
// 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.getUTCDate property "length" has { ReadOnly,
|
||||
DontDelete, DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: Checking DontEnum attribute
|
||||
---*/
|
||||
assert(
|
||||
!Date.prototype.getUTCDate.propertyIsEnumerable('length'),
|
||||
'The value of !Date.prototype.getUTCDate.propertyIsEnumerable(\'length\') is expected to be true'
|
||||
);
|
||||
|
||||
for (var x in Date.prototype.getUTCDate) {
|
||||
assert.notSameValue(x, "length", 'The value of x is not "length"');
|
||||
}
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
29
test/built-ins/Date/prototype/getUTCDate/length.js
vendored
Normal file
29
test/built-ins/Date/prototype/getUTCDate/length.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: >
|
||||
Date.prototype.getUTCDate.length is 0.
|
||||
info: |
|
||||
Date.prototype.getUTCDate ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in function object, including constructors, has a "length"
|
||||
property whose value is a non-negative integral Number. Unless otherwise
|
||||
specified, this value is the number of required parameters shown in the
|
||||
subclause heading for the function description. Optional parameters and rest
|
||||
parameters are not included in the parameter count.
|
||||
|
||||
Unless otherwise specified, the "length" property of a built-in function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype.getUTCDate, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/Date/prototype/getUTCDate/prop-desc.js
vendored
Normal file
22
test/built-ins/Date/prototype/getUTCDate/prop-desc.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-date.prototype.getutcdate
|
||||
description: >
|
||||
Property descriptor for Date.prototype.getUTCDate.
|
||||
info: |
|
||||
Date.prototype.getUTCDate ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every other data property described in clauses 19 through 28 and in
|
||||
Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(Date.prototype, "getUTCDate", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
// 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 "getUTCDay" has { DontEnum } attributes
|
||||
esid: sec-date.prototype.getutcdaty
|
||||
description: Checking absence of ReadOnly attribute
|
||||
---*/
|
||||
|
||||
var x = Date.prototype.getUTCDay;
|
||||
if (x === 1) {
|
||||
Date.prototype.getUTCDay = 2;
|
||||
} else {
|
||||
Date.prototype.getUTCDay = 1;
|
||||
}
|
||||
|
||||
assert.notSameValue(
|
||||
Date.prototype.getUTCDay,
|
||||
x,
|
||||
'The value of Date.prototype.getUTCDay is expected to not equal the value of `x`'
|
||||
);
|
||||
|
||||
// TODO: Convert to verifyProperty() format.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user