2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: >
|
|
|
|
The [[Value]] property of the newly constructed object
|
|
|
|
with supplied "undefined" argument should be NaN
|
2017-07-27 23:24:39 +02:00
|
|
|
esid: sec-date-year-month-date-hours-minutes-seconds-ms
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.9.3.1_A6_T1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: 2 arguments, (year, month)
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
function DateValue(year, month, date, hours, minutes, seconds, ms){
|
|
|
|
return new Date(year, month, date, hours, minutes, seconds, ms).valueOf();
|
|
|
|
}
|
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
var x;
|
|
|
|
x = DateValue(1899, 11);
|
|
|
|
assert.sameValue(x, NaN, "(1899, 11)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1899, 12);
|
|
|
|
assert.sameValue(x, NaN, "(1899, 12)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1900, 0);
|
|
|
|
assert.sameValue(x, NaN, "(1900, 0)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1969, 11);
|
|
|
|
assert.sameValue(x, NaN, "(1969, 11)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1969, 12);
|
|
|
|
assert.sameValue(x, NaN, "(1969, 12)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1970, 0);
|
|
|
|
assert.sameValue(x, NaN, "(1970, 0)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1999, 11);
|
|
|
|
assert.sameValue(x, NaN, "(1999, 11)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(1999, 12);
|
|
|
|
assert.sameValue(x, NaN, "(1999, 12)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(2000, 0);
|
|
|
|
assert.sameValue(x, NaN, "(2000, 0)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(2099, 11);
|
|
|
|
assert.sameValue(x, NaN, "(2099, 11)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(2099, 12);
|
|
|
|
assert.sameValue(x, NaN, "(2099, 12)");
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-07-01 20:22:55 +02:00
|
|
|
x = DateValue(2100, 0);
|
|
|
|
assert.sameValue(x, NaN, "(2100, 0)");
|