Skip to content
Snippets Groups Projects
Commit 018ad211 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

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.
parent 4dac3e4c
No related branches found
No related tags found
No related merge requests found
// 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"] ));
// 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");
// 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");
// 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);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment