mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Streamline tests for Date.prototype.toGMTString
Introduce a test that asserts the equality of `Date.prototype.toGMTString` and `Date.prototype.toUTCString`, rendering further tests for the former's behavior unnecessary.
This commit is contained in:
parent
4dac3e4ce8
commit
018ad2110d
@ -1,11 +0,0 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: Check type of various properties
|
|
||||||
es5id: B.2.6
|
|
||||||
description: Checking properties of the Date object (toGMTString)
|
|
||||||
---*/
|
|
||||||
|
|
||||||
if (typeof Date.prototype.toGMTString !== "function") $ERROR('#1: typeof Date.prototype.toGMTString === "function". Actual: ' + (typeof Date.prototype.toGMTString ));
|
|
||||||
if (typeof Date.prototype['toGMTString'] !== "function") $ERROR('#2: typeof Date.prototype["toGMTString"] === "function". Actual: ' + (typeof Date.prototype["toGMTString"] ));
|
|
@ -1,29 +0,0 @@
|
|||||||
// Copyright (C) 2015 André Bargull. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
es6id: B.2.4.3
|
|
||||||
description: >
|
|
||||||
Date.prototype.toGMTString.length is 0.
|
|
||||||
info: >
|
|
||||||
Date.prototype.toGMTString ( )
|
|
||||||
|
|
||||||
17 ECMAScript Standard Built-in Objects:
|
|
||||||
Every built-in Function object, including constructors, has a length
|
|
||||||
property whose value is an integer. Unless otherwise specified, this
|
|
||||||
value is equal to the largest number of named arguments shown in the
|
|
||||||
subclause headings for the function description, including optional
|
|
||||||
parameters. However, rest parameters shown using the form “...name”
|
|
||||||
are not included in the default argument 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]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
assert.sameValue(Date.prototype.toGMTString.length, 0);
|
|
||||||
|
|
||||||
verifyNotEnumerable(Date.prototype.toGMTString, "length");
|
|
||||||
verifyNotWritable(Date.prototype.toGMTString, "length");
|
|
||||||
verifyConfigurable(Date.prototype.toGMTString, "length");
|
|
@ -1,26 +0,0 @@
|
|||||||
// Copyright (C) 2015 André Bargull. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
es6id: B.2.4.3
|
|
||||||
description: >
|
|
||||||
Date.prototype.toGMTString.name is "toUTCString".
|
|
||||||
info: >
|
|
||||||
Date.prototype.toGMTString ( )
|
|
||||||
|
|
||||||
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.toGMTString.name, "toUTCString");
|
|
||||||
|
|
||||||
verifyNotEnumerable(Date.prototype.toGMTString, "name");
|
|
||||||
verifyNotWritable(Date.prototype.toGMTString, "name");
|
|
||||||
verifyConfigurable(Date.prototype.toGMTString, "name");
|
|
14
test/annexB/built-ins/Date/prototype/toGMTString/value.js
vendored
Normal file
14
test/annexB/built-ins/Date/prototype/toGMTString/value.js
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-date.prototype.togmtstring
|
||||||
|
es6id: B.2.4.3
|
||||||
|
es5id: B.2.6
|
||||||
|
description: Value of `Date.prototype.toGMTString`
|
||||||
|
info: >
|
||||||
|
The function object that is the initial value of Date.prototype.toGMTString
|
||||||
|
is the same function object that is the initial value of
|
||||||
|
Date.prototype.toUTCString.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Date.prototype.toGMTString, Date.prototype.toUTCString);
|
Loading…
x
Reference in New Issue
Block a user