Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Date/S15.9.3.1_A6_T2.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 [[Value]] property of the newly constructed object
7 with supplied "undefined" argument should be NaN
8 esid: sec-date-year-month-date-hours-minutes-seconds-ms
9 es5id: 15.9.3.1_A6_T2
10 description: 3 arguments, (year, month, date)
11 ---*/
12
13 function DateValue(year, month, date, hours, minutes, seconds, ms) {
14 return new Date(year, month, date, hours, minutes, seconds, ms).valueOf();
15 }
16
17 var x;
18 x = DateValue(1899, 11, 31);
19 assert.sameValue(x, NaN, "(1899, 11, 31)");
20
21 x = DateValue(1899, 12, 1);
22 assert.sameValue(x, NaN, "(1899, 12, 1)");
23
24 x = DateValue(1900, 0, 1);
25 assert.sameValue(x, NaN, "(1900, 0, 1)");
26
27 x = DateValue(1969, 11, 31);
28 assert.sameValue(x, NaN, "(1969, 11, 31)");
29
30 x = DateValue(1969, 12, 1);
31 assert.sameValue(x, NaN, "(1969, 12, 1)");
32
33 x = DateValue(1970, 0, 1);
34 assert.sameValue(x, NaN, "(1970, 0, 1)");
35
36 x = DateValue(1999, 11, 31);
37 assert.sameValue(x, NaN, "(1999, 11, 31)");
38
39 x = DateValue(1999, 12, 1);
40 assert.sameValue(x, NaN, "(1999, 12, 1)");
41
42 x = DateValue(2000, 0, 1);
43 assert.sameValue(x, NaN, "(2000, 0, 1)");
44
45 x = DateValue(2099, 11, 31);
46 assert.sameValue(x, NaN, "(2099, 11, 31)");
47
48 x = DateValue(2099, 12, 1);
49 assert.sameValue(x, NaN, "(2099, 12, 1)");
50
51 x = DateValue(2100, 0, 1);
52 assert.sameValue(x, NaN, "(2100, 0, 1)");