mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix Date(Number.POSITIVE_INFINITY) assertion fail in the Date constructor
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
This commit is contained in:
parent
6038173e76
commit
bbfddea032
@ -556,6 +556,11 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
|
||||
if (ecma_is_completion_value_empty (ret_value))
|
||||
{
|
||||
if (!ecma_number_is_nan (*prim_value_num_p) && ecma_number_is_infinity (*prim_value_num_p))
|
||||
{
|
||||
*prim_value_num_p = ecma_number_make_nan ();
|
||||
}
|
||||
|
||||
ecma_property_t *class_prop_p = ecma_create_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_CLASS);
|
||||
class_prop_p->u.internal_property.value = LIT_MAGIC_STRING_DATE_UL;
|
||||
|
||||
@ -44,6 +44,7 @@ catch (e)
|
||||
}
|
||||
|
||||
assert (new Date (NaN).toTimeString () == "Invalid Date");
|
||||
assert (Date (Number.POSITIVE_INFINITY).toString () === "Invalid Date");
|
||||
assert (new Date ("2015-02-13").toTimeString () == "00:00:00.000");
|
||||
assert (new Date ("2015-07-08T11:29:05.023").toTimeString () == "11:29:05.023");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user