mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
735 B
40 lines
735 B
/*---
|
|
{
|
|
"custom": true
|
|
}
|
|
---*/
|
|
|
|
/*===
|
|
RangeError
|
|
RangeError
|
|
1900-01-01T00:00:00.000Z
|
|
===*/
|
|
|
|
/* Date.UTC() has implementation defined results when it is given less than
|
|
* 2 arguments.
|
|
*
|
|
* V8 sets internal time value to NaN, i.e. behaves the same as if two
|
|
* 'undefined' arguments were given. Rhino, on the other hand, defaults
|
|
* the values to zero (leading to year 1970 and January).
|
|
*
|
|
* Our current behavior matches V8, so test for this behavior.
|
|
*/
|
|
|
|
try {
|
|
print(new Date(Date.UTC()).toISOString());
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
try {
|
|
print(new Date(Date.UTC(0)).toISOString());
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
try {
|
|
print(new Date(Date.UTC(0,0)).toISOString());
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
|