Renaming ecma_* identifiers from 'camelCase' to 'underscore_naming'.

This commit is contained in:
Ruben Ayrapetyan
2014-07-23 12:54:56 +04:00
parent b3b4c74cbe
commit bc0c7824c2
26 changed files with 702 additions and 702 deletions
+13 -13
View File
@@ -33,19 +33,19 @@
* false - otherwise.
*/
bool
ecma_abstract_equality_compare(ecma_Value_t x, /**< first operand */
ecma_Value_t y) /**< second operand */
ecma_abstract_equality_compare(ecma_value_t x, /**< first operand */
ecma_value_t y) /**< second operand */
{
const bool is_x_undefined = ecma_IsValueUndefined( x);
const bool is_x_null = ecma_IsValueNull( x);
const bool is_x_boolean = ecma_IsValueBoolean( x);
const bool is_x_undefined = ecma_is_value_undefined( x);
const bool is_x_null = ecma_is_value_null( x);
const bool is_x_boolean = ecma_is_value_boolean( x);
const bool is_x_number = ( x.ValueType == ECMA_TYPE_NUMBER );
const bool is_x_string = ( x.ValueType == ECMA_TYPE_STRING );
const bool is_x_object = ( x.ValueType == ECMA_TYPE_OBJECT );
const bool is_y_undefined = ecma_IsValueUndefined( y);
const bool is_y_null = ecma_IsValueNull( y);
const bool is_y_boolean = ecma_IsValueBoolean( y);
const bool is_y_undefined = ecma_is_value_undefined( y);
const bool is_y_null = ecma_is_value_null( y);
const bool is_y_boolean = ecma_is_value_boolean( y);
const bool is_y_number = ( y.ValueType == ECMA_TYPE_NUMBER );
const bool is_y_string = ( y.ValueType == ECMA_TYPE_STRING );
const bool is_y_object = ( y.ValueType == ECMA_TYPE_OBJECT );
@@ -68,18 +68,18 @@ ecma_abstract_equality_compare(ecma_Value_t x, /**< first operand */
return true;
} else if ( is_x_number )
{ // c.
ecma_Number_t x_num = *(ecma_Number_t*)( ecma_GetPointer(x.Value) );
ecma_Number_t y_num = *(ecma_Number_t*)( ecma_GetPointer(y.Value) );
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) );
TODO( Implement according to ECMA );
return (x_num == y_num);
} else if ( is_x_string )
{ // d.
ecma_ArrayFirstChunk_t* x_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(x.Value) );
ecma_ArrayFirstChunk_t* y_str = (ecma_ArrayFirstChunk_t*)( ecma_GetPointer(y.Value) );
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_CompareEcmaStringToEcmaString( x_str, y_str);
return ecma_compare_ecma_string_to_ecma_string( x_str, y_str);
} else if ( is_x_boolean )
{ // e.
return ( x.Value == y.Value );
+1 -1
View File
@@ -26,7 +26,7 @@
* @{
*/
extern bool ecma_abstract_equality_compare( ecma_Value_t x, ecma_Value_t y);
extern bool ecma_abstract_equality_compare( ecma_value_t x, ecma_value_t y);
/**
* @}
+24 -24
View File
@@ -37,19 +37,19 @@
* @return completion value
* Returned value must be freed with ecma_free_completion_value
*/
ecma_CompletionValue_t
ecma_op_check_object_coercible( ecma_Value_t value) /**< ecma-value */
ecma_completion_value_t
ecma_op_check_object_coercible( ecma_value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.ValueType )
switch ( (ecma_type_t)value.ValueType )
{
case ECMA_TYPE_SIMPLE:
{
switch ( (ecma_SimpleValue_t)value.Value )
switch ( (ecma_simple_value_t)value.Value )
{
case ECMA_SIMPLE_VALUE_UNDEFINED:
case ECMA_SIMPLE_VALUE_NULL:
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_TYPE));
}
case ECMA_SIMPLE_VALUE_FALSE:
case ECMA_SIMPLE_VALUE_TRUE:
@@ -78,9 +78,9 @@ ecma_op_check_object_coercible( ecma_Value_t value) /**< ecma-value */
}
}
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
} /* ecma_op_check_object_coercible */
/**
@@ -92,18 +92,18 @@ ecma_op_check_object_coercible( ecma_Value_t value) /**< ecma-value */
* @return completion value
* Returned value must be freed with ecma_free_completion_value
*/
ecma_CompletionValue_t
ecma_op_to_primitive( ecma_Value_t value) /**< ecma-value */
ecma_completion_value_t
ecma_op_to_primitive( ecma_value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.ValueType )
switch ( (ecma_type_t)value.ValueType )
{
case ECMA_TYPE_SIMPLE:
case ECMA_TYPE_NUMBER:
case ECMA_TYPE_STRING:
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( value),
ECMA_TARGET_ID_RESERVED);
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value( value),
ECMA_TARGET_ID_RESERVED);
}
case ECMA_TYPE_OBJECT:
{
@@ -127,16 +127,16 @@ ecma_op_to_primitive( ecma_Value_t value) /**< ecma-value */
* @return completion value
* Returned value must be freed with ecma_free_completion_value
*/
ecma_CompletionValue_t
ecma_op_to_number( ecma_Value_t value) /**< ecma-value */
ecma_completion_value_t
ecma_op_to_number( ecma_value_t value) /**< ecma-value */
{
switch ( (ecma_Type_t)value.ValueType )
switch ( (ecma_type_t)value.ValueType )
{
case ECMA_TYPE_NUMBER:
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( value),
ECMA_TARGET_ID_RESERVED);
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value( value),
ECMA_TARGET_ID_RESERVED);
}
case ECMA_TYPE_SIMPLE:
case ECMA_TYPE_STRING:
@@ -145,10 +145,10 @@ ecma_op_to_number( ecma_Value_t value) /**< ecma-value */
}
case ECMA_TYPE_OBJECT:
{
ecma_CompletionValue_t completion_to_primitive = ecma_op_to_primitive( value);
ecma_completion_value_t completion_to_primitive = ecma_op_to_primitive( value);
JERRY_ASSERT( ecma_is_completion_value_normal( completion_to_primitive) );
ecma_CompletionValue_t completion_to_number = ecma_op_to_number( completion_to_primitive.value);
ecma_completion_value_t completion_to_number = ecma_op_to_number( completion_to_primitive.value);
ecma_free_completion_value( completion_to_primitive);
return completion_to_number;
@@ -171,8 +171,8 @@ ecma_op_to_number( ecma_Value_t value) /**< ecma-value */
* @return completion value
* Returned value must be freed with ecma_free_completion_value
*/
ecma_CompletionValue_t
ecma_op_to_object( ecma_Value_t value) /**< ecma-value */
ecma_completion_value_t
ecma_op_to_object( ecma_value_t value) /**< ecma-value */
{
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS( value);
} /* ecma_op_to_object */
+4 -4
View File
@@ -26,10 +26,10 @@
* @{
*/
extern ecma_CompletionValue_t ecma_op_check_object_coercible( ecma_Value_t value);
extern ecma_CompletionValue_t ecma_op_to_primitive( ecma_Value_t value);
extern ecma_CompletionValue_t ecma_op_to_number( ecma_Value_t value);
extern ecma_CompletionValue_t ecma_op_to_object( ecma_Value_t value);
extern ecma_completion_value_t ecma_op_check_object_coercible( ecma_value_t value);
extern ecma_completion_value_t ecma_op_to_primitive( ecma_value_t value);
extern ecma_completion_value_t ecma_op_to_number( ecma_value_t value);
extern ecma_completion_value_t ecma_op_to_object( ecma_value_t value);
/**
* @}
+3 -3
View File
@@ -33,11 +33,11 @@
* @return pointer to ecma-object representing specified error
* with reference counter set to one.
*/
ecma_Object_t*
ecma_NewStandardError( ecma_StandardError_t error_type) /**< native error type */
ecma_object_t*
ecma_new_standard_error( ecma_standard_error_t error_type) /**< native error type */
{
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS( error_type);
} /* ecma_NewStandardError */
} /* ecma_new_standard_error */
/**
* @}
+2 -2
View File
@@ -41,9 +41,9 @@ typedef enum
ECMA_ERROR_SYNTAX, /**< SyntaxError */
ECMA_ERROR_TYPE, /**< TypeError */
ECMA_ERROR_URI /**< URIError */
} ecma_StandardError_t;
} ecma_standard_error_t;
extern ecma_Object_t *ecma_NewStandardError( ecma_StandardError_t error_type);
extern ecma_object_t *ecma_new_standard_error( ecma_standard_error_t error_type);
/**
* @}
+41 -41
View File
@@ -37,22 +37,22 @@
* @return completion value
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_CompletionValue_t
ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
ecma_completion_value_t
ecma_op_get_value( ecma_reference_t ref) /**< ECMA-reference */
{
const ecma_Value_t base = ref.base;
const bool is_unresolvable_reference = ecma_IsValueUndefined( base);
const bool has_primitive_base = ( ecma_IsValueBoolean( base)
const ecma_value_t base = ref.base;
const bool is_unresolvable_reference = ecma_is_value_undefined( base);
const bool has_primitive_base = ( ecma_is_value_boolean( base)
|| base.ValueType == ECMA_TYPE_NUMBER
|| base.ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.Value))->IsLexicalEnvironment );
&& !((ecma_object_t*)ecma_get_pointer(base.Value))->IsLexicalEnvironment );
const bool is_property_reference = has_primitive_base || has_object_base;
// GetValue_3
if ( is_unresolvable_reference )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_REFERENCE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_REFERENCE));
}
// GetValue_4
@@ -60,7 +60,7 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
{
if ( !has_primitive_base ) // GetValue_4.a
{
ecma_Object_t *obj_p = ecma_GetPointer( base.Value);
ecma_object_t *obj_p = ecma_get_pointer( base.Value);
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
// GetValue_4.b case 1
@@ -69,24 +69,24 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
} else
{ // GetValue_4.b case 2
/*
ecma_Object_t *obj_p = ecma_ToObject( base);
ecma_object_t *obj_p = ecma_ToObject( base);
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
ecma_Property_t *property = obj_p->[[GetProperty]]( ref.referenced_name_p);
ecma_property_t *property = obj_p->[[GetProperty]]( ref.referenced_name_p);
if ( property->Type == ECMA_PROPERTY_NAMEDDATA )
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( property->u.NamedDataProperty.Value),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value( property->u.NamedDataProperty.Value),
ECMA_TARGET_ID_RESERVED);
} else
{
JERRY_ASSERT( property->Type == ECMA_PROPERTY_NAMEDACCESSOR );
ecma_Object_t *getter = ecma_GetPointer( property->u.NamedAccessorProperty.pGet);
ecma_object_t *getter = ecma_get_pointer( property->u.NamedAccessorProperty.pGet);
if ( getter == NULL )
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED),
ECMA_TARGET_ID_RESERVED);
} else
{
@@ -99,11 +99,11 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
} else
{
// GetValue_5
ecma_Object_t *lex_env_p = ecma_GetPointer( base.Value);
ecma_object_t *lex_env_p = ecma_get_pointer( base.Value);
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
return ecma_OpGetBindingValue( lex_env_p, ref.referenced_name_p, ref.is_strict);
return ecma_op_get_binding_value( lex_env_p, ref.referenced_name_p, ref.is_strict);
}
} /* ecma_op_get_value */
@@ -115,28 +115,28 @@ ecma_op_get_value( ecma_Reference_t ref) /**< ECMA-reference */
* @return completion value
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_CompletionValue_t
ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
ecma_Value_t value) /**< ECMA-value */
ecma_completion_value_t
ecma_op_put_value(ecma_reference_t ref, /**< ECMA-reference */
ecma_value_t value) /**< ECMA-value */
{
const ecma_Value_t base = ref.base;
const bool is_unresolvable_reference = ecma_IsValueUndefined( base);
const bool has_primitive_base = ( ecma_IsValueBoolean( base)
const ecma_value_t base = ref.base;
const bool is_unresolvable_reference = ecma_is_value_undefined( base);
const bool has_primitive_base = ( ecma_is_value_boolean( base)
|| base.ValueType == ECMA_TYPE_NUMBER
|| base.ValueType == ECMA_TYPE_STRING );
const bool has_object_base = ( base.ValueType == ECMA_TYPE_OBJECT
&& !((ecma_Object_t*)ecma_GetPointer(base.Value))->IsLexicalEnvironment );
&& !((ecma_object_t*)ecma_get_pointer(base.Value))->IsLexicalEnvironment );
const bool is_property_reference = has_primitive_base || has_object_base;
if ( is_unresolvable_reference ) // PutValue_3
{
if ( ref.is_strict ) // PutValue_3.a
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_REFERENCE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_REFERENCE));
} else // PutValue_3.b
{
/*
ecma_Object_t *global_object_p = ecma_GetGlobalObject();
ecma_object_t *global_object_p = ecma_GetGlobalObject();
return global_object_p->[[Put]]( ref.referenced_name_p, value, false);
*/
@@ -157,7 +157,7 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
/*
// PutValue_sub_1
ecma_Object_t *obj_p = ecma_ToObject( base);
ecma_object_t *obj_p = ecma_ToObject( base);
JERRY_ASSERT( obj_p != NULL && !obj_p->IsLexicalEnvironment );
// PutValue_sub_2
@@ -166,17 +166,17 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
// PutValue_sub_2.a
if ( ref.is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_TYPE));
} else
{ // PutValue_sub_2.b
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
}
}
// PutValue_sub_3
ecma_Property_t *own_prop = obj_p->[[GetOwnProperty]]( ref.referenced_name_p);
ecma_property_t *own_prop = obj_p->[[GetOwnProperty]]( ref.referenced_name_p);
// PutValue_sub_4
if ( ecma_OpIsDataDescriptor( own_prop) )
@@ -184,23 +184,23 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
// PutValue_sub_4.a
if ( ref.is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_TYPE));
} else
{ // PutValue_sub_4.b
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
}
}
// PutValue_sub_5
ecma_Property_t *prop = obj_p->[[GetProperty]]( ref.referenced_name_p);
ecma_property_t *prop = obj_p->[[GetProperty]]( ref.referenced_name_p);
// PutValue_sub_6
if ( ecma_OpIsAccessorDescriptor( prop) )
{
// PutValue_sub_6.a
ecma_Object_t *setter = ecma_GetPointer( property->u.NamedAccessorProperty.pSet);
ecma_object_t *setter = ecma_get_pointer( property->u.NamedAccessorProperty.pSet);
JERRY_ASSERT( setter != NULL );
// PutValue_sub_6.b
@@ -210,13 +210,13 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
// PutValue_sub_7.a
if ( ref.is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_TYPE));
}
}
// PutValue_sub_8
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
*/
@@ -225,11 +225,11 @@ ecma_op_put_value(ecma_Reference_t ref, /**< ECMA-reference */
} else
{
// PutValue_7
ecma_Object_t *lex_env_p = ecma_GetPointer( base.Value);
ecma_object_t *lex_env_p = ecma_get_pointer( base.Value);
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
return ecma_OpSetMutableBinding( lex_env_p, ref.referenced_name_p, value, ref.is_strict);
return ecma_op_set_mutable_binding( lex_env_p, ref.referenced_name_p, value, ref.is_strict);
}
} /* ecma_op_put_value */
+74 -74
View File
@@ -37,19 +37,19 @@
* Return value is simple and so need not be freed.
* However, ecma_free_completion_value may be called for it, but it is a no-op.
*/
ecma_CompletionValue_t
ecma_OpHasBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
ecma_completion_value_t
ecma_op_has_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
ecma_SimpleValue_t has_binding = ECMA_SIMPLE_VALUE_UNDEFINED;
ecma_simple_value_t has_binding = ECMA_SIMPLE_VALUE_UNDEFINED;
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *property_p = ecma_FindNamedProperty( lex_env_p, name_p);
ecma_property_t *property_p = ecma_find_named_property( lex_env_p, name_p);
has_binding = ( property_p != NULL ) ? ECMA_SIMPLE_VALUE_TRUE
: ECMA_SIMPLE_VALUE_FALSE;
@@ -62,10 +62,10 @@ ecma_OpHasBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
}
}
return ecma_MakeCompletionValue(ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( has_binding),
return ecma_make_completion_value(ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( has_binding),
ECMA_TARGET_ID_RESERVED);
} /* ecma_OpHasBinding */
} /* ecma_op_has_binding */
/**
* CreateMutableBinding operation.
@@ -76,21 +76,21 @@ ecma_OpHasBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
* Return value is simple and so need not be freed.
* However, ecma_free_completion_value may be called for it, but it is a no-op.
*/
ecma_CompletionValue_t
ecma_OpCreateMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< argument N */
ecma_completion_value_t
ecma_op_create_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p, /**< argument N */
bool is_deletable) /**< argument D */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
JERRY_ASSERT( ecma_IsCompletionValueNormalFalse( ecma_OpHasBinding( lex_env_p, name_p)) );
JERRY_ASSERT( ecma_is_completion_value_normal_false( ecma_op_has_binding( lex_env_p, name_p)) );
ecma_CreateNamedProperty( lex_env_p,
ecma_create_named_property( lex_env_p,
name_p,
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
@@ -106,10 +106,10 @@ ecma_OpCreateMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment *
}
}
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
} /* ecma_OpCreateMutableBinding */
} /* ecma_op_create_mutable_binding */
/**
* SetMutableBinding operation.
@@ -119,30 +119,30 @@ ecma_OpCreateMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment *
* @return completion value
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_CompletionValue_t
ecma_OpSetMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< argument N */
ecma_Value_t value, /**< argument V */
ecma_completion_value_t
ecma_op_set_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p, /**< argument N */
ecma_value_t value, /**< argument V */
bool is_strict) /**< argument S */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
JERRY_ASSERT( ecma_IsCompletionValueNormalTrue( ecma_OpHasBinding( lex_env_p, name_p)) );
JERRY_ASSERT( ecma_is_completion_value_normal_true( ecma_op_has_binding( lex_env_p, name_p)) );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *property_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
ecma_property_t *property_p = ecma_get_named_data_property( lex_env_p, name_p);
if ( property_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_WRITABLE )
{
ecma_FreeValue( property_p->u.NamedDataProperty.Value);
property_p->u.NamedDataProperty.Value = ecma_CopyValue( value);
ecma_free_value( property_p->u.NamedDataProperty.Value);
property_p->u.NamedDataProperty.Value = ecma_copy_value( value);
} else if ( is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_TYPE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_TYPE));
}
break;
@@ -153,10 +153,10 @@ ecma_OpSetMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
}
}
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_EMPTY),
ECMA_TARGET_ID_RESERVED);
} /* ecma_OpSetMutableBinding */
} /* ecma_op_set_mutable_binding */
/**
* GetBindingValue operation.
@@ -166,29 +166,29 @@ ecma_OpSetMutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
* @return completion value
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_CompletionValue_t
ecma_OpGetBindingValue(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< argument N */
ecma_completion_value_t
ecma_op_get_binding_value(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p, /**< argument N */
bool is_strict) /**< argument S */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
JERRY_ASSERT( ecma_IsCompletionValueNormalTrue( ecma_OpHasBinding( lex_env_p, name_p)) );
JERRY_ASSERT( ecma_is_completion_value_normal_true( ecma_op_has_binding( lex_env_p, name_p)) );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *property_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
ecma_property_t *property_p = ecma_get_named_data_property( lex_env_p, name_p);
ecma_Value_t prop_value = property_p->u.NamedDataProperty.Value;
ecma_value_t prop_value = property_p->u.NamedDataProperty.Value;
/* is the binding mutable? */
if ( property_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_WRITABLE )
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_CopyValue( prop_value),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_copy_value( prop_value),
ECMA_TARGET_ID_RESERVED);
} else if ( prop_value.ValueType == ECMA_TYPE_SIMPLE
&& prop_value.Value == ECMA_SIMPLE_VALUE_EMPTY )
@@ -196,11 +196,11 @@ ecma_OpGetBindingValue(ecma_Object_t *lex_env_p, /**< lexical environment */
/* unitialized immutable binding */
if ( is_strict )
{
return ecma_MakeThrowValue( ecma_NewStandardError( ECMA_ERROR_REFERENCE));
return ecma_make_throw_value( ecma_new_standard_error( ECMA_ERROR_REFERENCE));
} else
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED),
ECMA_TARGET_ID_RESERVED);
}
}
@@ -214,7 +214,7 @@ ecma_OpGetBindingValue(ecma_Object_t *lex_env_p, /**< lexical environment */
}
JERRY_UNREACHABLE();
} /* ecma_OpGetBindingValue */
} /* ecma_op_get_binding_value */
/**
* DeleteBinding operation.
@@ -225,19 +225,19 @@ ecma_OpGetBindingValue(ecma_Object_t *lex_env_p, /**< lexical environment */
* Return value is simple and so need not be freed.
* However, ecma_free_completion_value may be called for it, but it is a no-op.
*/
ecma_CompletionValue_t
ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
ecma_completion_value_t
ecma_op_delete_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
JERRY_ASSERT( name_p != NULL );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_Property_t *prop_p = ecma_FindNamedProperty( lex_env_p, name_p);
ecma_SimpleValue_t ret_val;
ecma_property_t *prop_p = ecma_find_named_property( lex_env_p, name_p);
ecma_simple_value_t ret_val;
if ( prop_p == NULL )
{
@@ -251,14 +251,14 @@ ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ret_val = ECMA_SIMPLE_VALUE_FALSE;
} else
{
ecma_DeleteProperty( lex_env_p, prop_p);
ecma_delete_property( lex_env_p, prop_p);
ret_val = ECMA_SIMPLE_VALUE_TRUE;
}
}
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ret_val),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ret_val),
ECMA_TARGET_ID_RESERVED);
}
case ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND:
@@ -268,7 +268,7 @@ ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
}
JERRY_UNREACHABLE();
} /* ecma_OpDeleteBinding */
} /* ecma_op_delete_binding */
/**
* ImplicitThisValue operation.
@@ -278,17 +278,17 @@ ecma_OpDeleteBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
* @return completion value
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_CompletionValue_t
ecma_OpImplicitThisValue( ecma_Object_t *lex_env_p) /**< lexical environment */
ecma_completion_value_t
ecma_op_implicit_this_value( ecma_object_t *lex_env_p) /**< lexical environment */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED),
return ecma_make_completion_value( ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED),
ECMA_TARGET_ID_RESERVED);
}
case ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND:
@@ -298,7 +298,7 @@ ecma_OpImplicitThisValue( ecma_Object_t *lex_env_p) /**< lexical environment */
}
JERRY_UNREACHABLE();
} /* ecma_OpImplicitThisValue */
} /* ecma_op_implicit_this_value */
/**
* CreateImmutableBinding operation.
@@ -306,22 +306,22 @@ ecma_OpImplicitThisValue( ecma_Object_t *lex_env_p) /**< lexical environment */
* See also: ECMA-262 v5, 10.2.1
*/
void
ecma_OpCreateImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p) /**< argument N */
ecma_op_create_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p) /**< argument N */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
JERRY_ASSERT( ecma_IsCompletionValueNormalFalse( ecma_OpHasBinding( lex_env_p, name_p)) );
JERRY_ASSERT( ecma_is_completion_value_normal_false( ecma_op_has_binding( lex_env_p, name_p)) );
/*
* Warning:
* Whether immutable bindings are deletable seems not to be defined by ECMA v5.
*/
ecma_Property_t *prop_p = ecma_CreateNamedProperty( lex_env_p,
ecma_property_t *prop_p = ecma_create_named_property( lex_env_p,
name_p,
ECMA_PROPERTY_NOT_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
@@ -338,7 +338,7 @@ ecma_OpCreateImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment
}
JERRY_UNREACHABLE();
} /* ecma_OpCreateImmutableBinding */
} /* ecma_op_create_immutable_binding */
/**
* InitializeImmutableBinding operation.
@@ -346,26 +346,26 @@ ecma_OpCreateImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment
* See also: ECMA-262 v5, 10.2.1
*/
void
ecma_OpInitializeImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< argument N */
ecma_Value_t value) /**< argument V */
ecma_op_initialize_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p, /**< argument N */
ecma_value_t value) /**< argument V */
{
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->IsLexicalEnvironment );
switch ( (ecma_LexicalEnvironmentType_t) lex_env_p->u.LexicalEnvironment.Type )
switch ( (ecma_lexical_environment_type_t) lex_env_p->u.LexicalEnvironment.Type )
{
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
JERRY_ASSERT( ecma_IsCompletionValueNormalTrue( ecma_OpHasBinding( lex_env_p, name_p)) );
JERRY_ASSERT( ecma_is_completion_value_normal_true( ecma_op_has_binding( lex_env_p, name_p)) );
ecma_Property_t *prop_p = ecma_GetNamedDataProperty( lex_env_p, name_p);
ecma_property_t *prop_p = ecma_get_named_data_property( lex_env_p, name_p);
/* The binding must be unitialized immutable binding */
JERRY_ASSERT( prop_p->u.NamedDataProperty.Writable == ECMA_PROPERTY_NOT_WRITABLE
&& prop_p->u.NamedDataProperty.Value.ValueType == ECMA_TYPE_SIMPLE
&& prop_p->u.NamedDataProperty.Value.Value == ECMA_SIMPLE_VALUE_EMPTY );
prop_p->u.NamedDataProperty.Value = ecma_CopyValue( value);
prop_p->u.NamedDataProperty.Value = ecma_copy_value( value);
}
case ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND:
{
@@ -374,7 +374,7 @@ ecma_OpInitializeImmutableBinding(ecma_Object_t *lex_env_p, /**< lexical environ
}
JERRY_UNREACHABLE();
} /* ecma_OpInitializeImmutableBinding */
} /* ecma_op_initialize_immutable_binding */
/**
* @}
+8 -8
View File
@@ -29,16 +29,16 @@
*/
/* ECMA-262 v5, Table 17. Abstract methods of Environment Records */
extern ecma_CompletionValue_t ecma_OpHasBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p);
extern ecma_CompletionValue_t ecma_OpCreateMutableBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p, bool is_deletable);
extern ecma_CompletionValue_t ecma_OpSetMutableBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p, ecma_Value_t value, bool is_strict);
extern ecma_CompletionValue_t ecma_OpGetBindingValue( ecma_Object_t *lex_env_p, ecma_Char_t *name_p, bool is_strict);
extern ecma_CompletionValue_t ecma_OpDeleteBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p);
extern ecma_CompletionValue_t ecma_OpImplicitThisValue( ecma_Object_t *lex_env_p);
extern ecma_completion_value_t ecma_op_has_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
extern ecma_completion_value_t ecma_op_create_mutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_deletable);
extern ecma_completion_value_t ecma_op_set_mutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, ecma_value_t value, bool is_strict);
extern ecma_completion_value_t ecma_op_get_binding_value( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
extern ecma_completion_value_t ecma_op_delete_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
extern ecma_completion_value_t ecma_op_implicit_this_value( ecma_object_t *lex_env_p);
/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
extern void ecma_OpCreateImmutableBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p);
extern void ecma_OpInitializeImmutableBinding( ecma_Object_t *lex_env_p, ecma_Char_t *name_p, ecma_Value_t value);
extern void ecma_op_create_immutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
extern void ecma_op_initialize_immutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, ecma_value_t value);
/**
* @}
+19 -19
View File
@@ -33,9 +33,9 @@
*
* @return number - result of addition.
*/
ecma_Number_t
ecma_op_number_add(ecma_Number_t left_num, /**< left operand */
ecma_Number_t right_num) /**< right operand */
ecma_number_t
ecma_op_number_add(ecma_number_t left_num, /**< left operand */
ecma_number_t right_num) /**< right operand */
{
TODO( Implement according to ECMA );
@@ -50,9 +50,9 @@ ecma_op_number_add(ecma_Number_t left_num, /**< left operand */
*
* @return number - result of substraction.
*/
ecma_Number_t
ecma_op_number_substract(ecma_Number_t left_num, /**< left operand */
ecma_Number_t right_num) /**< right operand */
ecma_number_t
ecma_op_number_substract(ecma_number_t left_num, /**< left operand */
ecma_number_t right_num) /**< right operand */
{
return ecma_op_number_add( left_num, ecma_op_number_negate( right_num));
} /* ecma_op_number_substract */
@@ -65,9 +65,9 @@ ecma_op_number_substract(ecma_Number_t left_num, /**< left operand */
*
* @return number - result of multiplication.
*/
ecma_Number_t
ecma_op_number_multiply(ecma_Number_t left_num, /**< left operand */
ecma_Number_t right_num) /**< right operand */
ecma_number_t
ecma_op_number_multiply(ecma_number_t left_num, /**< left operand */
ecma_number_t right_num) /**< right operand */
{
TODO( Implement according to ECMA );
@@ -82,9 +82,9 @@ ecma_op_number_multiply(ecma_Number_t left_num, /**< left operand */
*
* @return number - result of division.
*/
ecma_Number_t
ecma_op_number_divide(ecma_Number_t left_num, /**< left operand */
ecma_Number_t right_num) /**< right operand */
ecma_number_t
ecma_op_number_divide(ecma_number_t left_num, /**< left operand */
ecma_number_t right_num) /**< right operand */
{
TODO( Implement according to ECMA );
@@ -99,15 +99,15 @@ ecma_op_number_divide(ecma_Number_t left_num, /**< left operand */
*
* @return number - calculated remainder.
*/
ecma_Number_t
ecma_op_number_remainder(ecma_Number_t left_num, /**< left operand */
ecma_Number_t right_num) /**< right operand */
ecma_number_t
ecma_op_number_remainder(ecma_number_t left_num, /**< left operand */
ecma_number_t right_num) /**< right operand */
{
TODO( Implement according to ECMA );
ecma_Number_t n = left_num, d = right_num;
ecma_number_t n = left_num, d = right_num;
return ( n - d * (ecma_Number_t)( (int32_t)( n / d ) ) );
return ( n - d * (ecma_number_t)( (int32_t)( n / d ) ) );
} /* ecma_op_number_remainder */
/**
@@ -118,8 +118,8 @@ ecma_op_number_remainder(ecma_Number_t left_num, /**< left operand */
*
* @return number - result of negation.
*/
ecma_Number_t
ecma_op_number_negate(ecma_Number_t num) /**< operand */
ecma_number_t
ecma_op_number_negate(ecma_number_t num) /**< operand */
{
TODO( Implement according to ECMA );
@@ -27,12 +27,12 @@
* @{
*/
extern ecma_Number_t ecma_op_number_add( ecma_Number_t left_num, ecma_Number_t right_num);
extern ecma_Number_t ecma_op_number_substract( ecma_Number_t left_num, ecma_Number_t right_num);
extern ecma_Number_t ecma_op_number_multiply( ecma_Number_t left_num, ecma_Number_t right_num);
extern ecma_Number_t ecma_op_number_divide( ecma_Number_t left_num, ecma_Number_t right_num);
extern ecma_Number_t ecma_op_number_remainder( ecma_Number_t left_num, ecma_Number_t right_num);
extern ecma_Number_t ecma_op_number_negate( ecma_Number_t num);
extern ecma_number_t ecma_op_number_add( ecma_number_t left_num, ecma_number_t right_num);
extern ecma_number_t ecma_op_number_substract( ecma_number_t left_num, ecma_number_t right_num);
extern ecma_number_t ecma_op_number_multiply( ecma_number_t left_num, ecma_number_t right_num);
extern ecma_number_t ecma_op_number_divide( ecma_number_t left_num, ecma_number_t right_num);
extern ecma_number_t ecma_op_number_remainder( ecma_number_t left_num, ecma_number_t right_num);
extern ecma_number_t ecma_op_number_negate( ecma_number_t num);
/**
* @}
+3 -3
View File
@@ -27,10 +27,10 @@
* @{
*/
extern ecma_Reference_t ecma_OpGetIdentifierReference( ecma_Object_t *lex_env_p, ecma_Char_t *name_p, bool is_strict);
extern ecma_reference_t ecma_op_get_identifier_reference( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
extern ecma_CompletionValue_t ecma_op_get_value( ecma_Reference_t ref);
extern ecma_CompletionValue_t ecma_op_put_value( ecma_Reference_t ref, ecma_Value_t value);
extern ecma_completion_value_t ecma_op_get_value( ecma_reference_t ref);
extern ecma_completion_value_t ecma_op_put_value( ecma_reference_t ref, ecma_value_t value);
/**
* @}
+22 -22
View File
@@ -37,39 +37,39 @@
* until the reference is freed.
*
* @return ECMA-reference
* Returned value must be freed through ecma_FreeReference.
* Returned value must be freed through ecma_free_reference.
*/
ecma_Reference_t
ecma_OpGetIdentifierReference(ecma_Object_t *lex_env_p, /**< lexical environment */
ecma_Char_t *name_p, /**< identifier's name */
ecma_reference_t
ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, /**< lexical environment */
ecma_char_t *name_p, /**< identifier's name */
bool is_strict) /**< strict reference flag */
{
JERRY_ASSERT( lex_env_p != NULL );
ecma_Object_t *lex_env_iter_p = lex_env_p;
ecma_object_t *lex_env_iter_p = lex_env_p;
while ( lex_env_iter_p != NULL )
{
ecma_CompletionValue_t completion_value;
completion_value = ecma_OpHasBinding( lex_env_iter_p, name_p);
ecma_completion_value_t completion_value;
completion_value = ecma_op_has_binding( lex_env_iter_p, name_p);
if ( ecma_IsCompletionValueNormalTrue( completion_value) )
if ( ecma_is_completion_value_normal_true( completion_value) )
{
return ecma_MakeReference( ecma_MakeObjectValue( lex_env_iter_p),
return ecma_make_reference( ecma_make_object_value( lex_env_iter_p),
name_p,
is_strict);
} else
{
JERRY_ASSERT( ecma_IsCompletionValueNormalFalse( completion_value) );
JERRY_ASSERT( ecma_is_completion_value_normal_false( completion_value) );
}
lex_env_iter_p = ecma_GetPointer( lex_env_iter_p->u.LexicalEnvironment.pOuterReference);
lex_env_iter_p = ecma_get_pointer( lex_env_iter_p->u.LexicalEnvironment.pOuterReference);
}
return ecma_MakeReference( ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_UNDEFINED),
return ecma_make_reference( ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED),
name_p,
is_strict);
} /* ecma_OpGetIdentifierReference */
} /* ecma_op_get_identifier_reference */
/**
* ECMA-reference constructor.
@@ -79,17 +79,17 @@ ecma_OpGetIdentifierReference(ecma_Object_t *lex_env_p, /**< lexical environment
* until the reference is freed.
*
* @return ECMA-reference
* Returned value must be freed through ecma_FreeReference.
* Returned value must be freed through ecma_free_reference.
*/
ecma_Reference_t
ecma_MakeReference(ecma_Value_t base, /**< base value */
ecma_Char_t *name_p, /**< referenced name */
ecma_reference_t
ecma_make_reference(ecma_value_t base, /**< base value */
ecma_char_t *name_p, /**< referenced name */
bool is_strict) /**< strict reference flag */
{
return (ecma_Reference_t) { .base = ecma_CopyValue( base),
return (ecma_reference_t) { .base = ecma_copy_value( base),
.referenced_name_p = name_p,
.is_strict = is_strict };
} /* ecma_MakeReference */
} /* ecma_make_reference */
/**
* Free specified ECMA-reference.
@@ -98,10 +98,10 @@ ecma_MakeReference(ecma_Value_t base, /**< base value */
* freeing invalidates all copies of the reference.
*/
void
ecma_FreeReference( const ecma_Reference_t ref) /**< reference */
ecma_free_reference( const ecma_reference_t ref) /**< reference */
{
ecma_FreeValue( ref.base);
} /* ecma_FreeReference */
ecma_free_value( ref.base);
} /* ecma_free_reference */
/**
* @}
+3 -3
View File
@@ -28,9 +28,9 @@
* @{
*/
extern ecma_Reference_t ecma_OpGetIdentifierReference(ecma_Object_t *lex_env_p, ecma_Char_t *name_p, bool is_strict);
extern ecma_Reference_t ecma_MakeReference( ecma_Value_t base, ecma_Char_t *name_p, bool is_strict);
extern void ecma_FreeReference( const ecma_Reference_t ref);
extern ecma_reference_t ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
extern ecma_reference_t ecma_make_reference( ecma_value_t base, ecma_char_t *name_p, bool is_strict);
extern void ecma_free_reference( const ecma_reference_t ref);
/**
* @}