Fix Date.prototype[@@toPrimitive] hint handling (#3967)
The Date.prototype[@@toPrimitive] only allows the "string", "default" and "number" hint values. Any other value should throw a TypeError. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -202,7 +202,7 @@ ecma_builtin_date_prototype_to_primitive (ecma_value_t this_arg, /**< this argum
|
||||
{
|
||||
ecma_string_t *hint_str_p = ecma_get_string_from_value (hint_arg);
|
||||
|
||||
ecma_preferred_type_hint_t hint = ECMA_PREFERRED_TYPE_NUMBER;
|
||||
ecma_preferred_type_hint_t hint = ECMA_PREFERRED_TYPE_NO;
|
||||
|
||||
if (hint_str_p == ecma_get_magic_string (LIT_MAGIC_STRING_STRING)
|
||||
|| hint_str_p == ecma_get_magic_string (LIT_MAGIC_STRING_DEFAULT))
|
||||
|
||||
Reference in New Issue
Block a user