]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/Date/15.9.5.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma / Date / 15.9.5.js
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
5 *
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
10 *
11 * The Original Code is Mozilla Communicator client code, released March
12 * 31, 1998.
13 *
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
17 * Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 */
22 /**
23 File Name: 15.9.5.js
24 ECMA Section: 15.9.5 Properties of the Date prototype object
25 Description:
26
27 The Date prototype object is itself a Date object (its [[Class]] is
28 "Date") whose value is NaN.
29
30 The value of the internal [[Prototype]] property of the Date prototype
31 object is the Object prototype object (15.2.3.1).
32
33 In following descriptions of functions that are properties of the Date
34 prototype object, the phrase "this Date object" refers to the object that
35 is the this value for the invocation of the function; it is an error if
36 this does not refer to an object for which the value of the internal
37 [[Class]] property is "Date". Also, the phrase "this time value" refers
38 to the number value for the time represented by this Date object, that is,
39 the value of the internal [[Value]] property of this Date object.
40
41 Author: christine@netscape.com
42 Date: 12 november 1997
43 */
44
45 var SECTION = "15.9.5";
46 var VERSION = "ECMA_1";
47 startTest();
48 var TITLE = "Properties of the Date Prototype Object";
49
50 writeHeaderToLog( SECTION + " "+ TITLE);
51
52 var testcases = new Array();
53
54 Date.prototype.getClass = Object.prototype.toString;
55
56 testcases[tc++] = new TestCase( SECTION,
57 "Date.prototype.getClass",
58 "[object Date]",
59 Date.prototype.getClass() );
60 testcases[tc++] = new TestCase( SECTION,
61 "Date.prototype.valueOf()",
62 NaN,
63 Date.prototype.valueOf() );
64 testcases[tc++] = new TestCase( SECTION,
65 "Date.prototype.__proto__ == Object.prototype",
66 true,
67 Date.prototype.__proto__ == Object.prototype );
68 test();
69 function test() {
70 for ( tc=0; tc < testcases.length; tc++ ) {
71 testcases[tc].passed = writeTestCaseResult(
72 testcases[tc].expect,
73 testcases[tc].actual,
74 testcases[tc].description +" = "+
75 testcases[tc].actual );
76
77 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
78 }
79 stopTest();
80 return ( testcases );
81 }