Update object.prototype.toString to conform ES11 standard (#4196)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg
2020-10-07 15:05:17 +02:00
committed by GitHub
parent 17fe441819
commit 99c7099eaa
4 changed files with 31 additions and 10 deletions
@@ -167,6 +167,18 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
ecma_deref_object (obj_p);
return ecma_builtin_helper_object_to_string_tag_helper (tag);
}
else if (builtin_tag != LIT_MAGIC_STRING_ARGUMENTS_UL
&& builtin_tag != LIT_MAGIC_STRING_FUNCTION_UL
&& builtin_tag != LIT_MAGIC_STRING_ERROR_UL
&& builtin_tag != LIT_MAGIC_STRING_BOOLEAN_UL
&& builtin_tag != LIT_MAGIC_STRING_NUMBER_UL
&& builtin_tag != LIT_MAGIC_STRING_STRING_UL
&& builtin_tag != LIT_MAGIC_STRING_DATE_UL
&& builtin_tag != LIT_MAGIC_STRING_REGEXP_UL
&& builtin_tag != LIT_MAGIC_STRING_ARRAY_UL)
{
builtin_tag = LIT_MAGIC_STRING_OBJECT_UL;
}
ecma_free_value (tag);
#endif /* ENABLED (JERRY_ESNEXT) */