blob: 890916f9b61e6559103d1469338bd124b67218a4 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright 2009 the Sputnik authors. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5info: >
6 The [[Class]] property of the newly constructed object
7 is set to "Date"
8es5id: 15.9.3.1_A3_T4.1
9description: >
10 Test based on delete prototype.toString - 5 arguments, (year,
11 month, date, hours, minutes)
12---*/
13
14var x1 = new Date(1899, 11, 31, 23, 59);
15if (Object.prototype.toString.call(x1) !== "[object Date]") {
16 $ERROR("#1: The [[Class]] property of the newly constructed object is set to 'Date'");
17}
18
19var x2 = new Date(1899, 12, 1, 0, 0);
20if (Object.prototype.toString.call(x2) !== "[object Date]") {
21 $ERROR("#2: The [[Class]] property of the newly constructed object is set to 'Date'");
22}
23
24var x3 = new Date(1900, 0, 1, 0, 0);
25if (Object.prototype.toString.call(x3) !== "[object Date]") {
26 $ERROR("#3: The [[Class]] property of the newly constructed object is set to 'Date'");
27}
28
29var x4 = new Date(1969, 11, 31, 23, 59);
30if (Object.prototype.toString.call(x4) !== "[object Date]") {
31 $ERROR("#4: The [[Class]] property of the newly constructed object is set to 'Date'");
32}
33
34var x5 = new Date(1969, 12, 1, 0, 0);
35if (Object.prototype.toString.call(x5) !== "[object Date]") {
36 $ERROR("#5: The [[Class]] property of the newly constructed object is set to 'Date'");
37}
38
39var x6 = new Date(1970, 0, 1, 0, 0);
40if (Object.prototype.toString.call(x6) !== "[object Date]") {
41 $ERROR("#6: The [[Class]] property of the newly constructed object is set to 'Date'");
42}
43
44var x7 = new Date(1999, 11, 31, 23, 59);
45if (Object.prototype.toString.call(x7) !== "[object Date]") {
46 $ERROR("#7: The [[Class]] property of the newly constructed object is set to 'Date'");
47}
48
49var x8 = new Date(1999, 12, 1, 0, 0);
50if (Object.prototype.toString.call(x8) !== "[object Date]") {
51 $ERROR("#8: The [[Class]] property of the newly constructed object is set to 'Date'");
52}
53
54var x9 = new Date(2000, 0, 1, 0, 0);
55if (Object.prototype.toString.call(x9) !== "[object Date]") {
56 $ERROR("#9: The [[Class]] property of the newly constructed object is set to 'Date'");
57}
58
59var x10 = new Date(2099, 11, 31, 23, 59);
60if (Object.prototype.toString.call(x10) !== "[object Date]") {
61 $ERROR("#10: The [[Class]] property of the newly constructed object is set to 'Date'");
62}
63
64var x11 = new Date(2099, 12, 1, 0, 0);
65if (Object.prototype.toString.call(x11) !== "[object Date]") {
66 $ERROR("#11: The [[Class]] property of the newly constructed object is set to 'Date'");
67}
68
69var x12 = new Date(2100, 0, 1, 0, 0);
70if (Object.prototype.toString.call(x12) !== "[object Date]") {
71 $ERROR("#12: The [[Class]] property of the newly constructed object is set to 'Date'");
72}