Primitive value of Date.prototype should be NaN

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó 2015-07-10 11:27:50 +02:00 committed by Lango
parent 122e5c47c9
commit 9c559216b7
2 changed files with 3 additions and 1 deletions

View File

@ -159,7 +159,7 @@ ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
case ECMA_BUILTIN_ID_DATE_PROTOTYPE:
{
ecma_number_t *prim_prop_num_value_p = ecma_alloc_number ();
*prim_prop_num_value_p = ECMA_NUMBER_ZERO;
*prim_prop_num_value_p = ecma_number_make_nan ();
ecma_property_t *prim_value_prop_p;
prim_value_prop_p = ecma_create_internal_property (object_obj_p,

View File

@ -29,6 +29,8 @@ catch (e)
assert (e.message === "foo");
}
assert (isNaN(Date.prototype.valueOf.call(Date.prototype)));
d = Date("abcd");
assert (isNaN(d.valueOf()));