Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Date/S15.9.3.1_A3_T4.1.js

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