Introducing CompactProfileError built-in object.
This commit is contained in:
@@ -110,4 +110,9 @@
|
|||||||
*/
|
*/
|
||||||
// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
|
// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation should correspond to ECMA Compact Profile
|
||||||
|
*/
|
||||||
|
#define CONFIG_ECMA_COMPACT_PROFILE
|
||||||
|
|
||||||
#endif /* !CONFIG_H */
|
#endif /* !CONFIG_H */
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
/* Copyright 2014 Samsung Electronics Co., Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ecma-alloc.h"
|
||||||
|
#include "ecma-builtins.h"
|
||||||
|
#include "ecma-conversion.h"
|
||||||
|
#include "ecma-exceptions.h"
|
||||||
|
#include "ecma-gc.h"
|
||||||
|
#include "ecma-globals.h"
|
||||||
|
#include "ecma-helpers.h"
|
||||||
|
#include "ecma-objects.h"
|
||||||
|
#include "ecma-try-catch-macro.h"
|
||||||
|
#include "globals.h"
|
||||||
|
|
||||||
|
#define ECMA_BUILTINS_INTERNAL
|
||||||
|
#include "ecma-builtins-internal.h"
|
||||||
|
|
||||||
|
/** \addtogroup ecma ECMA
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ecmabuiltins
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup compact_profile_error ECMA CompactProfileError object built-in
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of the Boolean object's built-in properties
|
||||||
|
*/
|
||||||
|
const ecma_length_t ecma_builtin_compact_profile_error_property_number = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the property's name is one of built-in properties of the CompactProfileError object
|
||||||
|
* that is not instantiated yet, instantiate the property and
|
||||||
|
* return pointer to the instantiated property.
|
||||||
|
*
|
||||||
|
* @return pointer property, if one was instantiated,
|
||||||
|
* NULL - otherwise.
|
||||||
|
*/
|
||||||
|
ecma_property_t*
|
||||||
|
ecma_builtin_compact_profile_error_try_to_instantiate_property (ecma_object_t *obj_p, /**< object */
|
||||||
|
ecma_string_t *prop_name_p) /**< property's name */
|
||||||
|
{
|
||||||
|
JERRY_ASSERT (ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR));
|
||||||
|
JERRY_ASSERT (ecma_find_named_property (obj_p, prop_name_p) == NULL);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
} /* ecma_builtin_compact_profile_error_try_to_instantiate_property */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatcher of the CompactProfileError object's built-in routines
|
||||||
|
*
|
||||||
|
* @return completion-value
|
||||||
|
* Returned value must be freed with ecma_free_completion_value.
|
||||||
|
*/
|
||||||
|
ecma_completion_value_t
|
||||||
|
ecma_builtin_compact_profile_error_dispatch_routine (ecma_magic_string_id_t builtin_routine_id __unused,
|
||||||
|
ecma_value_t this_arg_value __unused,
|
||||||
|
ecma_value_t arguments_list [] __unused,
|
||||||
|
ecma_length_t arguments_compact_profile_error __unused)
|
||||||
|
{
|
||||||
|
JERRY_UNREACHABLE ();
|
||||||
|
} /* ecma_builtin_compact_profile_error_dispatch_routine */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get compact_profile_error of routine's parameters
|
||||||
|
*
|
||||||
|
* @return compact_profile_error of parameters
|
||||||
|
*/
|
||||||
|
ecma_length_t
|
||||||
|
ecma_builtin_compact_profile_error_get_routine_parameters_number (ecma_magic_string_id_t builtin_routine_id __unused)
|
||||||
|
{
|
||||||
|
JERRY_UNREACHABLE ();
|
||||||
|
} /* ecma_builtin_compact_profile_error_get_routine_parameters_compact_profile_error */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle calling [[Call]] of built-in CompactProfileError object
|
||||||
|
*
|
||||||
|
* @return completion-value
|
||||||
|
*/
|
||||||
|
ecma_completion_value_t
|
||||||
|
ecma_builtin_compact_profile_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */
|
||||||
|
ecma_length_t arguments_list_len) /**< number of arguments */
|
||||||
|
{
|
||||||
|
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||||
|
|
||||||
|
return ecma_make_throw_obj_completion_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR));
|
||||||
|
} /* ecma_builtin_compact_profile_error_dispatch_call */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle calling [[Construct]] of built-in CompactProfileError object
|
||||||
|
*
|
||||||
|
* @return completion-value
|
||||||
|
*/
|
||||||
|
ecma_completion_value_t
|
||||||
|
ecma_builtin_compact_profile_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */
|
||||||
|
ecma_length_t arguments_list_len) /**< number of arguments */
|
||||||
|
{
|
||||||
|
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||||
|
|
||||||
|
return ecma_make_throw_obj_completion_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR));
|
||||||
|
} /* ecma_builtin_compact_profile_error_dispatch_construct */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
* @}
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
@@ -68,7 +68,10 @@ static const ecma_magic_string_id_t ecma_builtin_global_property_names[] =
|
|||||||
ECMA_MAGIC_STRING_DECODE_URI,
|
ECMA_MAGIC_STRING_DECODE_URI,
|
||||||
ECMA_MAGIC_STRING_DECODE_URI_COMPONENT,
|
ECMA_MAGIC_STRING_DECODE_URI_COMPONENT,
|
||||||
ECMA_MAGIC_STRING_ENCODE_URI,
|
ECMA_MAGIC_STRING_ENCODE_URI,
|
||||||
ECMA_MAGIC_STRING_ENCODE_URI_COMPONENT
|
ECMA_MAGIC_STRING_ENCODE_URI_COMPONENT,
|
||||||
|
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||||
|
ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL
|
||||||
|
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -530,6 +533,17 @@ ecma_builtin_global_try_to_instantiate_property (ecma_object_t *obj_p, /**< obje
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||||
|
case ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL:
|
||||||
|
{
|
||||||
|
ecma_object_t *compact_profile_error_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR);
|
||||||
|
|
||||||
|
value = ecma_make_object_value (compact_profile_error_obj_p);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||||
|
|
||||||
case ECMA_MAGIC_STRING_DATE_UL:
|
case ECMA_MAGIC_STRING_DATE_UL:
|
||||||
case ECMA_MAGIC_STRING_REG_EXP_UL:
|
case ECMA_MAGIC_STRING_REG_EXP_UL:
|
||||||
case ECMA_MAGIC_STRING_ERROR_UL:
|
case ECMA_MAGIC_STRING_ERROR_UL:
|
||||||
|
|||||||
@@ -124,6 +124,11 @@ ecma_builtin_bin_search_for_magic_string_id_in_array (const ecma_magic_string_id
|
|||||||
FUNCTION_UL, \
|
FUNCTION_UL, \
|
||||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||||
function) \
|
function) \
|
||||||
|
macro (COMPACT_PROFILE_ERROR, \
|
||||||
|
TYPE_GENERAL, \
|
||||||
|
COMPACT_PROFILE_ERROR_UL, \
|
||||||
|
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||||
|
compact_profile_error) \
|
||||||
macro (GLOBAL, \
|
macro (GLOBAL, \
|
||||||
TYPE_GENERAL, \
|
TYPE_GENERAL, \
|
||||||
OBJECT_UL, \
|
OBJECT_UL, \
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ typedef enum
|
|||||||
ECMA_BUILTIN_ID_SYNTAX_URI_ERROR, /**< the URIError object (15.11.6.6) */
|
ECMA_BUILTIN_ID_SYNTAX_URI_ERROR, /**< the URIError object (15.11.6.6) */
|
||||||
ECMA_BUILTIN_ID_MATH, /**< the Math object (15.8) */
|
ECMA_BUILTIN_ID_MATH, /**< the Math object (15.8) */
|
||||||
ECMA_BUILTIN_ID_JSON, /**< the JSON object (15.12) */
|
ECMA_BUILTIN_ID_JSON, /**< the JSON object (15.12) */
|
||||||
|
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||||
|
ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR, /**< CompactProfileError object defined in the Compact Profile */
|
||||||
|
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||||
ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */
|
ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */
|
||||||
} ecma_builtin_id_t;
|
} ecma_builtin_id_t;
|
||||||
|
|
||||||
|
|||||||
@@ -828,6 +828,7 @@ typedef enum
|
|||||||
ECMA_MAGIC_STRING_MIN_VALUE_U, /**< "MIN_VALUE" */
|
ECMA_MAGIC_STRING_MIN_VALUE_U, /**< "MIN_VALUE" */
|
||||||
ECMA_MAGIC_STRING_POSITIVE_INFINITY_U, /**< "POSITIVE_INFINITY" */
|
ECMA_MAGIC_STRING_POSITIVE_INFINITY_U, /**< "POSITIVE_INFINITY" */
|
||||||
ECMA_MAGIC_STRING_NEGATIVE_INFINITY_U, /**< "NEGATIVE_INFINITY" */
|
ECMA_MAGIC_STRING_NEGATIVE_INFINITY_U, /**< "NEGATIVE_INFINITY" */
|
||||||
|
ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL, /**< "CompactProfileError" */
|
||||||
ECMA_MAGIC_STRING_APPLY, /**< "apply" */
|
ECMA_MAGIC_STRING_APPLY, /**< "apply" */
|
||||||
ECMA_MAGIC_STRING_CALL, /**< "call" */
|
ECMA_MAGIC_STRING_CALL, /**< "call" */
|
||||||
ECMA_MAGIC_STRING_BIND, /**< "bind" */
|
ECMA_MAGIC_STRING_BIND, /**< "bind" */
|
||||||
|
|||||||
@@ -1452,6 +1452,7 @@ ecma_get_magic_string_zt (ecma_magic_string_id_t id) /**< magic string id */
|
|||||||
case ECMA_MAGIC_STRING_MIN_VALUE_U: return (ecma_char_t*) "MIN_VALUE";
|
case ECMA_MAGIC_STRING_MIN_VALUE_U: return (ecma_char_t*) "MIN_VALUE";
|
||||||
case ECMA_MAGIC_STRING_POSITIVE_INFINITY_U: return (ecma_char_t*) "POSITIVE_INFINITY";
|
case ECMA_MAGIC_STRING_POSITIVE_INFINITY_U: return (ecma_char_t*) "POSITIVE_INFINITY";
|
||||||
case ECMA_MAGIC_STRING_NEGATIVE_INFINITY_U: return (ecma_char_t*) "NEGATIVE_INFINITY";
|
case ECMA_MAGIC_STRING_NEGATIVE_INFINITY_U: return (ecma_char_t*) "NEGATIVE_INFINITY";
|
||||||
|
case ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL: return (ecma_char_t*) "CompactProfileError";
|
||||||
case ECMA_MAGIC_STRING_APPLY: return (ecma_char_t*) "apply";
|
case ECMA_MAGIC_STRING_APPLY: return (ecma_char_t*) "apply";
|
||||||
case ECMA_MAGIC_STRING_CALL: return (ecma_char_t*) "call";
|
case ECMA_MAGIC_STRING_CALL: return (ecma_char_t*) "call";
|
||||||
case ECMA_MAGIC_STRING_BIND: return (ecma_char_t*) "bind";
|
case ECMA_MAGIC_STRING_BIND: return (ecma_char_t*) "bind";
|
||||||
|
|||||||
Reference in New Issue
Block a user