Style fixes regarding 'empty' value: introducing ecma_is_empty_completion_value, reducing usage of the 'empty' value, listing possible usage cases of the 'empty' value in the comment to it's definition.

This commit is contained in:
Ruben Ayrapetyan
2014-07-28 21:21:31 +04:00
parent 177a2d1382
commit 3ee0e8a8a5
7 changed files with 81 additions and 60 deletions
+1 -2
View File
@@ -127,8 +127,7 @@ run_int_from_pos (int start_pos,
completion = __opfuncs[curr->op_idx](*curr, &int_data);
JERRY_ASSERT( !ecma_is_completion_value_normal( completion)
|| ecma_is_completion_value_normal_simple_value(completion,
ECMA_SIMPLE_VALUE_EMPTY) );
|| ecma_is_empty_completion_value( completion) );
} while ( completion.type == ECMA_COMPLETION_TYPE_NORMAL );
if ( completion.type == ECMA_COMPLETION_TYPE_BREAK )
+4 -8
View File
@@ -912,8 +912,7 @@ opfunc_pre_incr(OPCODE opdata, /**< operation data */
ecma_completion_value_t reg_assignment_res = set_variable_value (int_data,
dst_var_idx,
new_num_value);
JERRY_ASSERT( ecma_is_completion_value_normal_simple_value (reg_assignment_res,
ECMA_SIMPLE_VALUE_EMPTY) );
JERRY_ASSERT( ecma_is_empty_completion_value( reg_assignment_res) );
ecma_dealloc_number( new_num_p);
@@ -963,8 +962,7 @@ opfunc_pre_decr(OPCODE opdata, /**< operation data */
ecma_completion_value_t reg_assignment_res = set_variable_value (int_data,
dst_var_idx,
new_num_value);
JERRY_ASSERT( ecma_is_completion_value_normal_simple_value (reg_assignment_res,
ECMA_SIMPLE_VALUE_EMPTY) );
JERRY_ASSERT( ecma_is_empty_completion_value (reg_assignment_res) );
ecma_dealloc_number( new_num_p);
@@ -1014,8 +1012,7 @@ opfunc_post_incr(OPCODE opdata, /**< operation data */
ecma_completion_value_t reg_assignment_res = set_variable_value (int_data,
dst_var_idx,
old_value.value);
JERRY_ASSERT( ecma_is_completion_value_normal_simple_value (reg_assignment_res,
ECMA_SIMPLE_VALUE_EMPTY) );
JERRY_ASSERT( ecma_is_empty_completion_value( reg_assignment_res) );
ECMA_FINALIZE(old_num_value);
ECMA_FINALIZE(old_value);
@@ -1063,8 +1060,7 @@ opfunc_post_decr(OPCODE opdata, /**< operation data */
ecma_completion_value_t reg_assignment_res = set_variable_value (int_data,
dst_var_idx,
old_value.value);
JERRY_ASSERT( ecma_is_completion_value_normal_simple_value (reg_assignment_res,
ECMA_SIMPLE_VALUE_EMPTY) );
JERRY_ASSERT( ecma_is_empty_completion_value (reg_assignment_res) );
ECMA_FINALIZE(old_num_value);
ECMA_FINALIZE(old_value);