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 [email protected]
This commit is contained in:
1 parent
e943d12286
commit
55d6637da5
3 files changed
+9
-2
No files matched your search
@@ -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