Styles fixes in libecmaobjects, libecmaoperations: indentation and braces rules.
This commit is contained in:
@@ -45,9 +45,9 @@ ecma_pack_code_internal_property_value (bool is_strict, /**< is code strict? */
|
||||
JERRY_ASSERT(((value) & (1u << is_strict_bit_offset)) == 0);
|
||||
|
||||
if (is_strict)
|
||||
{
|
||||
value |= (1u << is_strict_bit_offset);
|
||||
}
|
||||
{
|
||||
value |= (1u << is_strict_bit_offset);
|
||||
}
|
||||
|
||||
return value;
|
||||
} /* ecma_pack_code_internal_property_value */
|
||||
@@ -86,9 +86,9 @@ bool
|
||||
ecma_op_is_callable (ecma_value_t value) /**< ecma-value */
|
||||
{
|
||||
if (value.value_type != ECMA_TYPE_OBJECT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER(value.value);
|
||||
|
||||
@@ -96,7 +96,7 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma-value */
|
||||
JERRY_ASSERT(!obj_p->is_lexical_environment);
|
||||
|
||||
return (obj_p->u.object.type == ECMA_OBJECT_TYPE_FUNCTION
|
||||
|| obj_p->u.object.type == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
|| obj_p->u.object.type == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
} /* ecma_op_is_callable */
|
||||
|
||||
/**
|
||||
@@ -137,9 +137,9 @@ ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[], /*
|
||||
|
||||
// 10., 11., 14., 15.
|
||||
if (formal_parameters_number != 0)
|
||||
{
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(formal_parameter_list_p);
|
||||
}
|
||||
{
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(formal_parameter_list_p);
|
||||
}
|
||||
|
||||
// 12.
|
||||
ecma_property_t *code_prop_p = ecma_create_internal_property (f, ECMA_INTERNAL_PROPERTY_CODE);
|
||||
@@ -152,19 +152,19 @@ ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[], /*
|
||||
|
||||
// 17.
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
{
|
||||
prop_desc.is_value_defined = true;
|
||||
prop_desc.value = ecma_make_object_value (f);
|
||||
{
|
||||
prop_desc.is_value_defined = true;
|
||||
prop_desc.value = ecma_make_object_value (f);
|
||||
|
||||
prop_desc.is_writable_defined = true;
|
||||
prop_desc.writable = ECMA_PROPERTY_WRITABLE;
|
||||
prop_desc.is_writable_defined = true;
|
||||
prop_desc.writable = ECMA_PROPERTY_WRITABLE;
|
||||
|
||||
prop_desc.is_enumerable_defined = true;
|
||||
prop_desc.enumerable = ECMA_PROPERTY_NOT_ENUMERABLE;
|
||||
prop_desc.is_enumerable_defined = true;
|
||||
prop_desc.enumerable = ECMA_PROPERTY_NOT_ENUMERABLE;
|
||||
|
||||
prop_desc.is_configurable_defined = true;
|
||||
prop_desc.configurable = ECMA_PROPERTY_CONFIGURABLE;
|
||||
}
|
||||
prop_desc.is_configurable_defined = true;
|
||||
prop_desc.configurable = ECMA_PROPERTY_CONFIGURABLE;
|
||||
}
|
||||
|
||||
ecma_op_object_define_own_property (proto_p,
|
||||
ecma_get_magic_string (ECMA_MAGIC_STRING_CONSTRUCTOR),
|
||||
@@ -183,37 +183,37 @@ ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[], /*
|
||||
|
||||
// 19.
|
||||
if (is_strict)
|
||||
{
|
||||
ecma_object_t *thrower_p = ecma_op_get_throw_type_error ();
|
||||
|
||||
prop_desc = ecma_make_empty_property_descriptor ();
|
||||
{
|
||||
ecma_object_t *thrower_p = ecma_op_get_throw_type_error ();
|
||||
prop_desc.is_enumerable_defined = true;
|
||||
prop_desc.enumerable = ECMA_PROPERTY_NOT_ENUMERABLE;
|
||||
|
||||
prop_desc = ecma_make_empty_property_descriptor ();
|
||||
{
|
||||
prop_desc.is_enumerable_defined = true;
|
||||
prop_desc.enumerable = ECMA_PROPERTY_NOT_ENUMERABLE;
|
||||
prop_desc.is_configurable_defined = true;
|
||||
prop_desc.configurable = ECMA_PROPERTY_NOT_CONFIGURABLE;
|
||||
|
||||
prop_desc.is_configurable_defined = true;
|
||||
prop_desc.configurable = ECMA_PROPERTY_NOT_CONFIGURABLE;
|
||||
prop_desc.is_get_defined = true;
|
||||
prop_desc.get_p = thrower_p;
|
||||
|
||||
prop_desc.is_get_defined = true;
|
||||
prop_desc.get_p = thrower_p;
|
||||
|
||||
prop_desc.is_set_defined = true;
|
||||
prop_desc.set_p = thrower_p;
|
||||
}
|
||||
|
||||
ecma_op_object_define_own_property (f,
|
||||
ecma_get_magic_string (ECMA_MAGIC_STRING_CALLER),
|
||||
prop_desc,
|
||||
false);
|
||||
|
||||
ecma_op_object_define_own_property (f,
|
||||
ecma_get_magic_string (ECMA_MAGIC_STRING_ARGUMENTS),
|
||||
prop_desc,
|
||||
false);
|
||||
|
||||
ecma_deref_object (thrower_p);
|
||||
prop_desc.is_set_defined = true;
|
||||
prop_desc.set_p = thrower_p;
|
||||
}
|
||||
|
||||
ecma_op_object_define_own_property (f,
|
||||
ecma_get_magic_string (ECMA_MAGIC_STRING_CALLER),
|
||||
prop_desc,
|
||||
false);
|
||||
|
||||
ecma_op_object_define_own_property (f,
|
||||
ecma_get_magic_string (ECMA_MAGIC_STRING_ARGUMENTS),
|
||||
prop_desc,
|
||||
false);
|
||||
|
||||
ecma_deref_object (thrower_p);
|
||||
}
|
||||
|
||||
return f;
|
||||
} /* ecma_op_create_function_object */
|
||||
|
||||
@@ -236,81 +236,81 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
JERRY_ASSERT(arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (func_obj_p->u.object.type == ECMA_OBJECT_TYPE_FUNCTION)
|
||||
{
|
||||
ecma_completion_value_t ret_value;
|
||||
|
||||
/* Entering Function Code (ECMA-262 v5, 10.4.3) */
|
||||
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_property_t *code_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_CODE);
|
||||
|
||||
ecma_object_t *scope_p = ECMA_GET_POINTER(scope_prop_p->u.internal_property.value);
|
||||
uint32_t code_prop_value = code_prop_p->u.internal_property.value;
|
||||
|
||||
bool is_strict;
|
||||
// 8.
|
||||
opcode_counter_t code_first_opcode_idx = ecma_unpack_code_internal_property_value (code_prop_value, &is_strict);
|
||||
|
||||
ecma_value_t this_binding;
|
||||
// 1.
|
||||
if (is_strict)
|
||||
{
|
||||
ecma_completion_value_t ret_value;
|
||||
|
||||
/* Entering Function Code (ECMA-262 v5, 10.4.3) */
|
||||
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_property_t *code_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_CODE);
|
||||
|
||||
ecma_object_t *scope_p = ECMA_GET_POINTER(scope_prop_p->u.internal_property.value);
|
||||
uint32_t code_prop_value = code_prop_p->u.internal_property.value;
|
||||
|
||||
bool is_strict;
|
||||
// 8.
|
||||
opcode_counter_t code_first_opcode_idx = ecma_unpack_code_internal_property_value (code_prop_value, &is_strict);
|
||||
|
||||
ecma_value_t this_binding;
|
||||
// 1.
|
||||
if (is_strict)
|
||||
{
|
||||
this_binding = ecma_copy_value (this_arg_value, true);
|
||||
}
|
||||
else if (ecma_is_value_undefined (this_arg_value)
|
||||
|| ecma_is_value_null (this_arg_value))
|
||||
{
|
||||
// 2.
|
||||
FIXME(Assign Global object when it will be implemented);
|
||||
|
||||
this_binding = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3., 4.
|
||||
ecma_completion_value_t completion = ecma_op_to_object (this_arg_value);
|
||||
JERRY_ASSERT(ecma_is_completion_value_normal (completion));
|
||||
|
||||
this_binding = completion.value;
|
||||
}
|
||||
|
||||
// 5.
|
||||
ecma_object_t *local_env_p = ecma_create_decl_lex_env (scope_p);
|
||||
|
||||
// 9.
|
||||
/* Declaration binding instantiation (ECMA-262 v5, 10.5), block 4 */
|
||||
TODO(Perform declaration binding instantion when [[FormalParameters]] list will be supported);
|
||||
if (arguments_list_len != 0)
|
||||
{
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(arguments_list_p);
|
||||
}
|
||||
|
||||
ecma_completion_value_t completion = run_int_from_pos (code_first_opcode_idx,
|
||||
this_binding,
|
||||
local_env_p,
|
||||
is_strict);
|
||||
if (ecma_is_completion_value_normal (completion))
|
||||
{
|
||||
JERRY_ASSERT(ecma_is_empty_completion_value (completion));
|
||||
|
||||
ret_value = ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = completion;
|
||||
}
|
||||
|
||||
ecma_deref_object (local_env_p);
|
||||
ecma_free_value (this_binding, true);
|
||||
|
||||
return ret_value;
|
||||
this_binding = ecma_copy_value (this_arg_value, true);
|
||||
}
|
||||
else if (ecma_is_value_undefined (this_arg_value)
|
||||
|| ecma_is_value_null (this_arg_value))
|
||||
{
|
||||
// 2.
|
||||
FIXME(Assign Global object when it will be implemented);
|
||||
|
||||
this_binding = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3., 4.
|
||||
ecma_completion_value_t completion = ecma_op_to_object (this_arg_value);
|
||||
JERRY_ASSERT(ecma_is_completion_value_normal (completion));
|
||||
|
||||
this_binding = completion.value;
|
||||
}
|
||||
|
||||
// 5.
|
||||
ecma_object_t *local_env_p = ecma_create_decl_lex_env (scope_p);
|
||||
|
||||
// 9.
|
||||
/* Declaration binding instantiation (ECMA-262 v5, 10.5), block 4 */
|
||||
TODO(Perform declaration binding instantion when [[FormalParameters]] list will be supported);
|
||||
if (arguments_list_len != 0)
|
||||
{
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(arguments_list_p);
|
||||
}
|
||||
|
||||
ecma_completion_value_t completion = run_int_from_pos (code_first_opcode_idx,
|
||||
this_binding,
|
||||
local_env_p,
|
||||
is_strict);
|
||||
if (ecma_is_completion_value_normal (completion))
|
||||
{
|
||||
JERRY_ASSERT(ecma_is_empty_completion_value (completion));
|
||||
|
||||
ret_value = ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = completion;
|
||||
}
|
||||
|
||||
ecma_deref_object (local_env_p);
|
||||
ecma_free_value (this_binding, true);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT(func_obj_p->u.object.type == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
{
|
||||
JERRY_ASSERT(func_obj_p->u.object.type == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
|
||||
JERRY_UNIMPLEMENTED();
|
||||
}
|
||||
JERRY_UNIMPLEMENTED();
|
||||
}
|
||||
} /* ecma_op_function_call */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user