Update Symbol.split functions for String and Regexp to match new standard (#3942)
In newest ES standard limit parameter is calculated using ToUint32 function instead of ToLength. JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
@@ -795,10 +795,13 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a
|
||||
uint32_t limit = UINT32_MAX;
|
||||
if (!ecma_is_value_undefined (limit_value))
|
||||
{
|
||||
if (ECMA_IS_VALUE_ERROR (ecma_op_to_length (limit_value, &limit)))
|
||||
/* ECMA-262 v11, 21.1.3.20 6 */
|
||||
ecma_number_t num;
|
||||
if (ECMA_IS_VALUE_ERROR (ecma_get_number (limit_value, &num)))
|
||||
{
|
||||
goto cleanup_string;
|
||||
}
|
||||
limit = ecma_number_to_uint32 (num);
|
||||
}
|
||||
|
||||
/* 12. */
|
||||
|
||||
Reference in New Issue
Block a user