Update ToLength operation to conform ES6 spec (#4007)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-07-29 11:13:34 +02:00
committed by GitHub
parent 56e328be41
commit 3eb69075f7
31 changed files with 735 additions and 485 deletions
+3 -3
View File
@@ -35,11 +35,11 @@ main (void)
jmem_init ();
ecma_init ();
uint32_t num;
ecma_length_t num;
ecma_value_t int_num = ecma_make_int32_value (123);
uint32_t result = ecma_op_to_length (int_num, &num);
ecma_value_t result = ecma_op_to_length (int_num, &num);
ecma_free_value (int_num);
@@ -88,7 +88,7 @@ main (void)
TEST_ASSERT (!ECMA_IS_VALUE_ERROR (result));
#if ENABLED (JERRY_ESNEXT)
TEST_ASSERT (num == UINT32_MAX);
TEST_ASSERT (num == ECMA_NUMBER_MAX_SAFE_INTEGER);
#else /* !ENABLED (JERRY_ESNEXT) */
TEST_ASSERT (num == 0);
#endif /* ENABLED (JERRY_ESNEXT) */