Date.parse should reject out of range values (#4248)
The spec doesn't say explicitly that Date.parse should call TimeClip abstract operation at the end. But Date object can represent time values only in the range 1970 Jan 01 +/-8,640,000,000,000,000 ms. JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
This commit is contained in:
committed by
GitHub
parent
261a55c6b5
commit
7458766033
@@ -610,7 +610,7 @@ ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */
|
||||
|
||||
ECMA_FINALIZE_UTF8_STRING (date_start_p, date_start_size);
|
||||
ecma_deref_ecma_string (date_str_p);
|
||||
return ecma_make_number_value (ret_value);
|
||||
return ecma_make_number_value (ecma_date_time_clip (ret_value));
|
||||
} /* ecma_builtin_date_parse */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user