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.
30 lines
706 B
30 lines
706 B
/*===
|
|
123
|
|
123
|
|
123
|
|
123
|
|
123
|
|
-123
|
|
-123
|
|
===*/
|
|
|
|
/* The internal time value of an Ecmascript Date has no fractions.
|
|
* For instance, TimeClip() applies ToInteger() for all finite
|
|
* values.
|
|
*
|
|
* Check that this is the case. Also check that rounding happens
|
|
* correctly; ToInteger() rounds towards zero.
|
|
*/
|
|
|
|
try {
|
|
print(new Date(2012, 0, 1, 11, 22, 33, 123).getTime() % 1000);
|
|
print(new Date(2012, 0, 1, 11, 22, 33, 123.1).getTime() % 1000);
|
|
print(new Date(2012, 0, 1, 11, 22, 33, 123.9).getTime() % 1000);
|
|
|
|
print(new Date(123.1).getTime());
|
|
print(new Date(123.9).getTime());
|
|
print(new Date(-123.1).getTime());
|
|
print(new Date(-123.9).getTime());
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|