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
|
|
|
|
is set by following steps:
|
|
|
|
8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is
|
|
|
|
1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1)
|
|
|
|
9. Compute MakeDay(Result(8), Result(2), Result(3))
|
|
|
|
10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7))
|
|
|
|
11. Compute MakeDate(Result(9), Result(10))
|
|
|
|
12. Set the [[Value]] property of the newly constructed object to
|
|
|
|
TimeClip(UTC(Result(11)))
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.9.3.1_A5_T2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: 3 arguments, (year, month, date)
|
|
|
|
includes:
|
|
|
|
- numeric_conversion.js
|
|
|
|
- Date_constants.js
|
|
|
|
- Date_library.js
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (-2209046400000 !== new Date(1899, 11, 31).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#1: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (-2208960000000 !== new Date(1899, 12, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#2: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (-2208960000000 !== new Date(1900, 0, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#3: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (-57600000 !== new Date(1969, 11, 31).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#4: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (28800000 !== new Date(1969, 12, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#5: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (28800000 !== new Date(1970, 0, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#6: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (946627200000 !== new Date(1999, 11, 31).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#7: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (946713600000 !== new Date(1999, 12, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#8: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (946713600000 !== new Date(2000, 0, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#9: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (4102387200000 !== new Date(2099, 11, 31).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#10: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (4102473600000 !== new Date(2099, 12, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#11: Incorrect value of Date");
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|
|
|
|
|
2012-03-26 22:50:38 +02:00
|
|
|
if (4102473600000 !== new Date(2100, 0, 1).valueOf()) {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR("#12: Incorrect value of Date");
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|