| 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_T5 |
| 10 |
description: 6 arguments, (year, month, date, hours, minutes, seconds) |
| 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, 23, 59, 59); |
| 19 |
assert.sameValue(x, NaN, "(1899, 11, 31, 23, 59, 59)"); |
| 20 |
|
| 21 |
x = DateValue(1899, 12, 1, 0, 0, 0); |
| 22 |
assert.sameValue(x, NaN, "(1899, 12, 1, 0, 0, 0)"); |
| 23 |
|
| 24 |
x = DateValue(1900, 0, 1, 0, 0, 0); |
| 25 |
assert.sameValue(x, NaN, "(1900, 0, 1, 0, 0, 0)"); |
| 26 |
|
| 27 |
x = DateValue(1969, 11, 31, 23, 59, 59); |
| 28 |
assert.sameValue(x, NaN, "(1969, 11, 31, 23, 59, 59)"); |
| 29 |
|
| 30 |
x = DateValue(1969, 12, 1, 0, 0, 0); |
| 31 |
assert.sameValue(x, NaN, "(1969, 12, 1, 0, 0, 0)"); |
| 32 |
|
| 33 |
x = DateValue(1970, 0, 1, 0, 0, 0); |
| 34 |
assert.sameValue(x, NaN, "(1970, 0, 1, 0, 0, 0)"); |
| 35 |
|
| 36 |
x = DateValue(1999, 11, 31, 23, 59, 59); |
| 37 |
assert.sameValue(x, NaN, "(1999, 11, 31, 23, 59, 59)"); |
| 38 |
|
| 39 |
x = DateValue(1999, 12, 1, 0, 0, 0); |
| 40 |
assert.sameValue(x, NaN, "(1999, 12, 1, 0, 0, 0)"); |
| 41 |
|
| 42 |
x = DateValue(2000, 0, 1, 0, 0, 0); |
| 43 |
assert.sameValue(x, NaN, "(2000, 0, 1, 0, 0, 0)"); |
| 44 |
|
| 45 |
x = DateValue(2099, 11, 31, 23, 59, 59); |
| 46 |
assert.sameValue(x, NaN, "(2099, 11, 31, 23, 59, 59)"); |
| 47 |
|
| 48 |
x = DateValue(2099, 12, 1, 0, 0, 0); |
| 49 |
assert.sameValue(x, NaN, "(2099, 12, 1, 0, 0, 0)"); |
| 50 |
|
| 51 |
x = DateValue(2100, 0, 1, 0, 0, 0); |
| 52 |
assert.sameValue(x, NaN, "(2100, 0, 1, 0, 0, 0)"); |