Skip to content

Commit 4b0a3f1

Browse files
Fix incorrect interchange of interfaces taking to ecma values and ecma completion values.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
1 parent 7d4569a commit 4b0a3f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ ecma_builtin_array_prototype_object_to_locale_string (const ecma_value_t this_ar
489489
ecma_op_to_object (this_arg),
490490
ret_value);
491491

492-
ecma_object_t *obj_p = ecma_get_object_from_completion_value (obj_value);
492+
ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
493493

494494
ecma_string_t *length_magic_string_p = ecma_get_magic_string (ECMA_MAGIC_STRING_LENGTH);
495495

@@ -532,7 +532,7 @@ ecma_builtin_array_prototype_object_to_locale_string (const ecma_value_t this_ar
532532
ecma_builtin_helper_get_to_locale_string_at_index (obj_p, k),
533533
ret_value);
534534

535-
ecma_string_t *next_string_p = ecma_get_string_from_completion_value (next_string_value);
535+
ecma_string_t *next_string_p = ecma_get_string_from_value (next_string_value);
536536

537537
ecma_deref_ecma_string (return_string_p);
538538

@@ -1736,7 +1736,7 @@ ecma_builtin_array_prototype_object_every (ecma_value_t this_arg, /**< this argu
17361736
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
17371737

17381738
/* 7.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
1739-
if (!ecma_is_value_true (ecma_op_to_boolean (call_value)))
1739+
if (ecma_is_completion_value_normal_false (ecma_op_to_boolean (call_value)))
17401740
{
17411741
ret_value = ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
17421742
}
@@ -1837,7 +1837,7 @@ ecma_builtin_array_prototype_object_some (ecma_value_t this_arg, /**< this argum
18371837
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
18381838

18391839
/* 7.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
1840-
if (ecma_is_value_true (ecma_op_to_boolean (call_value)))
1840+
if (ecma_is_completion_value_normal_true (ecma_op_to_boolean (call_value)))
18411841
{
18421842
ret_value = ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_TRUE);
18431843
}
@@ -1944,7 +1944,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t this_arg, /**< this arg
19441944
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
19451945

19461946
/* 9.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
1947-
if (ecma_is_value_true (ecma_op_to_boolean (call_value)))
1947+
if (ecma_is_completion_value_normal_true (ecma_op_to_boolean (call_value)))
19481948
{
19491949
ecma_string_t* to_index_string_p = ecma_new_ecma_string_from_uint32 (new_array_index);
19501950
/*

jerry-core/ecma/builtin-objects/ecma-builtin-object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unuse
428428
ecma_op_to_object (arg2),
429429
ret_value);
430430

431-
ecma_object_t *props_p = ecma_get_object_from_completion_value (props);
431+
ecma_object_t *props_p = ecma_get_object_from_value (props);
432432
ecma_property_t *property_p;
433433

434434
// First we need to know how many properties should be stored
@@ -490,7 +490,7 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unuse
490490

491491
// 5.b
492492
ECMA_TRY_CATCH (conv_result,
493-
ecma_op_to_property_descriptor (ecma_get_completion_value_value (desc_obj),
493+
ecma_op_to_property_descriptor (desc_obj,
494494
&property_descriptors[index]),
495495
ret_value);
496496

jerry-core/vm/opcodes-native-call.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ opfunc_native_call (opcode_t opdata, /**< operation data */
4141

4242
JERRY_STATIC_ASSERT (OPCODE_NATIVE_CALL__COUNT < (1u << (sizeof (native_call_id_idx) * JERRY_BITSINBYTE)));
4343

44-
ecma_completion_value_t ret_value = 0;
44+
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
4545

4646
MEM_DEFINE_LOCAL_ARRAY (arg_values, args_number, ecma_value_t);
4747

0 commit comments

Comments
 (0)