Implement ToPropertyKey operation (#3966)

From ES 6 the ToPropertyKey operation is used to convert elements to a valid property key.
This "new" method uses the ToPrimitive operation which can call the `@@ToPrimitive`
well-known symbol to convert the given element to a key.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál
2020-07-06 15:17:18 +02:00
committed by GitHub
parent ed9e3eccf9
commit ae5cfae3e7
10 changed files with 174 additions and 30 deletions
@@ -159,7 +159,7 @@ opfunc_in (ecma_value_t left_value, /**< left value */
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object in 'in' check."));
}
ecma_string_t *property_name_p = ecma_op_to_prop_name (left_value);
ecma_string_t *property_name_p = ecma_op_to_property_key (left_value);
if (JERRY_UNLIKELY (property_name_p == NULL))
{