Style fixes in liballocator, libecmaobjects, libecmaoperations: putting else on separate line after closing brace of 'if' block.

This commit is contained in:
Ruben Ayrapetyan
2014-08-12 13:52:01 +04:00
parent 701f03309a
commit aa43e06366
8 changed files with 68 additions and 34 deletions
+12 -6
View File
@@ -68,7 +68,8 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
{
// a., b.
return true;
} else if (is_x_number)
}
else if (is_x_number)
{ // c.
ecma_number_t x_num = *(ecma_number_t*)(ECMA_GET_POINTER(x.value));
ecma_number_t y_num = *(ecma_number_t*)(ECMA_GET_POINTER(y.value));
@@ -76,26 +77,31 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
TODO(Implement according to ECMA);
return (x_num == y_num);
} else if (is_x_string)
}
else if (is_x_string)
{ // d.
ecma_array_first_chunk_t* x_str = (ecma_array_first_chunk_t*)(ECMA_GET_POINTER(x.value));
ecma_array_first_chunk_t* y_str = (ecma_array_first_chunk_t*)(ECMA_GET_POINTER(y.value));
return ecma_compare_ecma_string_to_ecma_string (x_str, y_str);
} else if (is_x_boolean)
}
else if (is_x_boolean)
{ // e.
return (x.value == y.value);
} else
}
else
{ // f.
JERRY_ASSERT(is_x_object);
return (x.value == y.value);
}
} else if ((is_x_null && is_y_undefined)
}
else if ((is_x_null && is_y_undefined)
|| (is_x_undefined && is_y_null))
{ // 2., 3.
return true;
} else
}
else
{
JERRY_UNIMPLEMENTED();
}
+4 -2
View File
@@ -218,11 +218,13 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */
if (ecma_is_value_boolean (value))
{
return ecma_make_simple_completion_value (value.value);
} else if (ecma_is_value_undefined (value)
}
else if (ecma_is_value_undefined (value)
|| ecma_is_value_null (value))
{
return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
} else
}
else
{
JERRY_UNREACHABLE();
}
+22 -11
View File
@@ -69,7 +69,8 @@ ecma_op_get_value (ecma_reference_t ref) /**< ECMA-reference */
// GetValue_4.b case 1
/* return [[Get]](base as this, ref.referenced_name_p) */
JERRY_UNIMPLEMENTED();
} else
}
else
{ // GetValue_4.b case 2
/*
ecma_object_t *obj_p = ecma_ToObject (base);
@@ -80,7 +81,8 @@ ecma_op_get_value (ecma_reference_t ref) /**< ECMA-reference */
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value (property->u.named_data_property.value),
ECMA_TARGET_ID_RESERVED);
} else
}
else
{
JERRY_ASSERT(property->Type == ECMA_PROPERTY_NAMEDACCESSOR);
@@ -91,7 +93,8 @@ ecma_op_get_value (ecma_reference_t ref) /**< ECMA-reference */
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
ECMA_TARGET_ID_RESERVED);
} else
}
else
{
return [[Call]](getter, base as this);
}
@@ -99,7 +102,8 @@ ecma_op_get_value (ecma_reference_t ref) /**< ECMA-reference */
*/
JERRY_UNIMPLEMENTED();
}
} else
}
else
{
// GetValue_5
ecma_object_t *lex_env_p = ECMA_GET_POINTER(base.value);
@@ -136,7 +140,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
if (ref.is_strict) // PutValue_3.a
{
return ecma_make_throw_value (ecma_new_standard_error (ECMA_ERROR_REFERENCE));
} else // PutValue_3.b
}
else // PutValue_3.b
{
ecma_object_t *global_object_p = ecma_get_global_object ();
@@ -152,7 +157,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
return ecma_make_empty_completion_value ();
}
} else if (is_property_reference) // PutValue_4
}
else if (is_property_reference) // PutValue_4
{
if (!has_primitive_base) // PutValue_4.a
{
@@ -160,7 +166,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
/* return [[Put]](base as this, ref.referenced_name_p, value, ref.is_strict); */
JERRY_UNIMPLEMENTED();
} else
}
else
{
// PutValue_4.b case 2
@@ -176,7 +183,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
if (ref.is_strict)
{
return ecma_make_throw_value (ecma_new_standard_error (ECMA_ERROR_TYPE));
} else
}
else
{ // PutValue_sub_2.b
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY),
@@ -194,7 +202,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
if (ref.is_strict)
{
return ecma_make_throw_value (ecma_new_standard_error (ECMA_ERROR_TYPE));
} else
}
else
{ // PutValue_sub_4.b
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY),
@@ -214,7 +223,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
// PutValue_sub_6.b
return [[Call]](setter, base as this, value);
} else // PutValue_sub_7
}
else // PutValue_sub_7
{
// PutValue_sub_7.a
if (ref.is_strict)
@@ -231,7 +241,8 @@ ecma_op_put_value (ecma_reference_t ref, /**< ECMA-reference */
JERRY_UNIMPLEMENTED();
}
} else
}
else
{
// PutValue_7
ecma_object_t *lex_env_p = ECMA_GET_POINTER(base.value);
+8 -4
View File
@@ -264,13 +264,15 @@ ecma_op_get_binding_value (ecma_object_t *lex_env_p, /**< lexical environment */
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value (prop_value, true),
ECMA_TARGET_ID_RESERVED);
} else if (ecma_is_value_empty (prop_value))
}
else if (ecma_is_value_empty (prop_value))
{
/* unitialized immutable binding */
if (is_strict)
{
return ecma_make_throw_value (ecma_new_standard_error (ECMA_ERROR_REFERENCE));
} else
}
else
{
return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_UNDEFINED);
}
@@ -329,14 +331,16 @@ ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
if (prop_p == NULL)
{
ret_val = ECMA_SIMPLE_VALUE_TRUE;
} else
}
else
{
JERRY_ASSERT(prop_p->type == ECMA_PROPERTY_NAMEDDATA);
if (prop_p->u.named_data_property.configurable == ECMA_PROPERTY_NOT_CONFIGURABLE)
{
ret_val = ECMA_SIMPLE_VALUE_FALSE;
} else
}
else
{
ecma_delete_property (lex_env_p, prop_p);
+2 -1
View File
@@ -58,7 +58,8 @@ ecma_op_get_identifier_reference (ecma_object_t *lex_env_p, /**< lexical environ
return ecma_make_reference (ecma_make_object_value (lex_env_iter_p),
name_p,
is_strict);
} else
}
else
{
JERRY_ASSERT(ecma_is_completion_value_normal_false (completion_value));
}