Removing ECMA_TYPE__COUNT enum value; fixing comment to ecma_copy_value

This commit is contained in:
Ruben Ayrapetyan 2014-08-22 17:50:57 +04:00
parent a8486b01ed
commit dca9bcc387
4 changed files with 8 additions and 45 deletions

View File

@ -56,8 +56,7 @@ typedef enum
ECMA_TYPE_SIMPLE, /**< simple value */
ECMA_TYPE_NUMBER, /**< 64-bit integer */
ECMA_TYPE_STRING, /**< pointer to description of a string */
ECMA_TYPE_OBJECT, /**< pointer to description of an object */
ECMA_TYPE__COUNT /**< count of types */
ECMA_TYPE_OBJECT /**< pointer to description of an object */
} ecma_type_t;
/**

View File

@ -163,17 +163,17 @@ ecma_make_object_value (ecma_object_t* object_p) /**< object to reference in val
* switch (valuetype)
* case simple:
* simply return the value as it was passed;
* case number/string:
* copy the number/string
* case number:
* copy the number
* and return new ecma-value
* pointing to copy of the number/string;
* pointing to copy of the number;
* case string:
* increase reference counter of the string
* and return the value as it was passed.
* case object;
* increase reference counter of the object if do_ref_if_object is true
* and return the value as it was passed.
*
* TODO:
* reference counter in strings
*
* @return See note.
*/
ecma_value_t
@ -214,11 +214,7 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */
ecma_ref_ecma_string (string_p);
value_copy = (ecma_value_t)
{
.value_type = ECMA_TYPE_STRING
};
ECMA_SET_POINTER(value_copy.value, string_p);
value_copy = value;
break;
}
@ -236,10 +232,6 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */
break;
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
return value_copy;
@ -283,11 +275,6 @@ ecma_free_value (ecma_value_t value, /**< value description */
}
break;
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
} /* ecma_free_value */

View File

@ -69,11 +69,6 @@ ecma_op_check_object_coercible (ecma_value_t value) /**< ecma-value */
{
break;
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
return ecma_make_empty_completion_value ();
@ -180,11 +175,6 @@ ecma_op_to_primitive (ecma_value_t value, /**< ecma-value */
{
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(preferred_type);
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
JERRY_UNREACHABLE();
@ -249,10 +239,6 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */
break;
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
JERRY_UNREACHABLE();
@ -293,10 +279,6 @@ ecma_op_to_number (ecma_value_t value) /**< ecma-value */
return completion_to_number;
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
JERRY_UNREACHABLE();
@ -386,7 +368,6 @@ ecma_op_to_string (ecma_value_t value) /**< ecma-value */
}
case ECMA_TYPE_OBJECT:
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE ();
}

View File

@ -110,10 +110,6 @@ ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of construct
ecma_make_object_value (obj_p),
ECMA_TARGET_ID_RESERVED);
}
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
}
JERRY_UNREACHABLE();