mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixing build without CONFIG_ECMA_COMPACT_PROFILE.
This commit is contained in:
parent
5c4d73f4a3
commit
5c4d2085a1
@ -239,7 +239,7 @@ TRY_TO_INSTANTIATE_PROPERTY_ROUTINE_NAME (BUILTIN_UNDERSCORED_ID) (ecma_object_t
|
||||
return compact_profile_thrower_property_p; \
|
||||
}
|
||||
#else /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||
#define CP_UNIMPLEMENTED_VALUE(name) case name: \
|
||||
#define CP_UNIMPLEMENTED_VALUE(name, value, prop_writable, prop_enumerable, prop_configurable) case name: \
|
||||
{ \
|
||||
JERRY_UNIMPLEMENTED ("The built-in is not implemented."); \
|
||||
}
|
||||
|
||||
@ -55,198 +55,12 @@ ecma_builtin_bin_search_for_magic_string_id_in_array (const ecma_magic_string_id
|
||||
ecma_length_t array_length,
|
||||
ecma_magic_string_id_t key);
|
||||
|
||||
/**
|
||||
* List of built-in objects in format
|
||||
* 'macro (builtin_id, object_type, object_class, object_prototype_builtin_id, is_extensible, lowercase_name)'
|
||||
*/
|
||||
#define ECMA_BUILTIN_LIST(macro) \
|
||||
macro (OBJECT_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
OBJECT_UL, \
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */, \
|
||||
true, \
|
||||
object_prototype) \
|
||||
macro (FUNCTION_PROTOTYPE, \
|
||||
TYPE_FUNCTION, \
|
||||
FUNCTION_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
function_prototype) \
|
||||
macro (ARRAY_PROTOTYPE, \
|
||||
TYPE_ARRAY, \
|
||||
ARRAY_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
array_prototype) \
|
||||
macro (STRING_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
STRING_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
string_prototype) \
|
||||
macro (BOOLEAN_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
BOOLEAN_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
boolean_prototype) \
|
||||
macro (NUMBER_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
NUMBER_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
number_prototype) \
|
||||
macro (OBJECT, \
|
||||
TYPE_FUNCTION, \
|
||||
OBJECT_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
object) \
|
||||
macro (MATH, \
|
||||
TYPE_GENERAL, \
|
||||
MATH_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
math) \
|
||||
macro (ARRAY, \
|
||||
TYPE_FUNCTION, \
|
||||
ARRAY_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
true, \
|
||||
array) \
|
||||
macro (STRING, \
|
||||
TYPE_FUNCTION, \
|
||||
STRING_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
true, \
|
||||
string) \
|
||||
macro (BOOLEAN, \
|
||||
TYPE_FUNCTION, \
|
||||
BOOLEAN_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
true, \
|
||||
boolean) \
|
||||
macro (NUMBER, \
|
||||
TYPE_FUNCTION, \
|
||||
NUMBER_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
true, \
|
||||
number) \
|
||||
macro (FUNCTION, \
|
||||
TYPE_FUNCTION, \
|
||||
FUNCTION_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
true, \
|
||||
function) \
|
||||
macro (ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
true, \
|
||||
error_prototype) \
|
||||
macro (ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
error) \
|
||||
macro (EVAL_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
eval_error_prototype) \
|
||||
macro (EVAL_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
eval_error) \
|
||||
macro (RANGE_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
range_error_prototype) \
|
||||
macro (RANGE_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
range_error) \
|
||||
macro (REFERENCE_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
reference_error_prototype) \
|
||||
macro (REFERENCE_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
reference_error) \
|
||||
macro (SYNTAX_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
syntax_error_prototype) \
|
||||
macro (SYNTAX_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
syntax_error) \
|
||||
macro (TYPE_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
type_error_prototype) \
|
||||
macro (TYPE_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
type_error) \
|
||||
macro (URI_ERROR_PROTOTYPE, \
|
||||
TYPE_GENERAL, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
uri_error_prototype) \
|
||||
macro (URI_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, \
|
||||
true, \
|
||||
uri_error) \
|
||||
macro (TYPE_ERROR_THROWER, \
|
||||
TYPE_FUNCTION, \
|
||||
FUNCTION_UL, \
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
|
||||
false, \
|
||||
type_error_thrower) \
|
||||
macro (COMPACT_PROFILE_ERROR, \
|
||||
TYPE_FUNCTION, \
|
||||
COMPACT_PROFILE_ERROR_UL, \
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
|
||||
false, \
|
||||
compact_profile_error) \
|
||||
macro (GLOBAL, \
|
||||
TYPE_GENERAL, \
|
||||
OBJECT_UL, \
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */, \
|
||||
true, \
|
||||
global)
|
||||
|
||||
#define DECLARE_DISPATCH_ROUTINES(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
extern ecma_completion_value_t \
|
||||
ecma_builtin_ ## lowercase_name ## _dispatch_call (ecma_value_t *arguments_list_p, \
|
||||
ecma_length_t arguments_list_len); \
|
||||
@ -263,15 +77,12 @@ ecma_builtin_ ## lowercase_name ## _try_to_instantiate_property (ecma_object_t *
|
||||
ecma_string_t *prop_name_p); \
|
||||
extern void \
|
||||
ecma_builtin_ ## lowercase_name ## _sort_property_names (void);
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
ECMA_BUILTIN_LIST (DECLARE_DISPATCH_ROUTINES)
|
||||
|
||||
#undef DECLARE_PROPERTY_NUMBER_VARIABLES
|
||||
#undef DECLARE_DISPATCH_ROUTINES
|
||||
|
||||
#ifndef CONFIG_ECMA_COMPACT_PROFILE
|
||||
# define ECMA_BUILTIN_CP_UNIMPLEMENTED(...) \
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS ("Compact Profile optional built-in.", __VA_ARGS__)
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS ("Built-in is not implemented.", __VA_ARGS__)
|
||||
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
|
||||
# define ECMA_BUILTIN_CP_UNIMPLEMENTED(...) \
|
||||
{ \
|
||||
|
||||
@ -173,15 +173,15 @@ ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
#define CASE_BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case ECMA_BUILTIN_ID_ ## builtin_id: \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
JERRY_ASSERT (ecma_builtin_objects [ECMA_BUILTIN_ID_ ## builtin_id] == NULL); \
|
||||
JERRY_ASSERT (ecma_builtin_objects [builtin_id] == NULL); \
|
||||
ecma_builtin_ ## lowercase_name ## _sort_property_names (); \
|
||||
\
|
||||
ecma_object_t *prototype_obj_p; \
|
||||
@ -199,19 +199,16 @@ ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
|
||||
JERRY_ASSERT (prototype_obj_p != NULL); \
|
||||
} \
|
||||
\
|
||||
ecma_object_t *builtin_obj_p = ecma_builtin_init_object (ECMA_BUILTIN_ID_ ## builtin_id, \
|
||||
ecma_object_t *builtin_obj_p = ecma_builtin_init_object (builtin_id, \
|
||||
prototype_obj_p, \
|
||||
ECMA_OBJECT_ ## object_type, \
|
||||
ECMA_MAGIC_STRING_ ## object_class, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
is_extensible); \
|
||||
ecma_builtin_objects [ECMA_BUILTIN_ID_ ## builtin_id] = builtin_obj_p; \
|
||||
ecma_builtin_objects [builtin_id] = builtin_obj_p; \
|
||||
\
|
||||
break; \
|
||||
}
|
||||
|
||||
ECMA_BUILTIN_LIST (CASE_BUILTIN);
|
||||
|
||||
#undef CASE_BUILTIN
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
default:
|
||||
{
|
||||
@ -263,21 +260,18 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
|
||||
switch (builtin_id)
|
||||
{
|
||||
#define TRY_TO_INSTANTIATE_PROPERTY(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case ECMA_BUILTIN_ID_ ## builtin_id: \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
return ecma_builtin_ ## lowercase_name ## _try_to_instantiate_property (object_p, \
|
||||
string_p); \
|
||||
}
|
||||
|
||||
ECMA_BUILTIN_LIST (TRY_TO_INSTANTIATE_PROPERTY)
|
||||
|
||||
#undef TRY_TO_INSTANTIATE_PROPERTY
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
case ECMA_BUILTIN_ID__COUNT:
|
||||
{
|
||||
@ -404,15 +398,15 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
|
||||
|
||||
switch (builtin_id)
|
||||
{
|
||||
#define DISPATCH_CALL(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case ECMA_BUILTIN_ID_ ## builtin_id: \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
if (ECMA_OBJECT_ ## object_type == ECMA_OBJECT_TYPE_FUNCTION) \
|
||||
if (object_type == ECMA_OBJECT_TYPE_FUNCTION) \
|
||||
{ \
|
||||
return ecma_builtin_ ## lowercase_name ## _dispatch_call (arguments_list_p, \
|
||||
arguments_list_len); \
|
||||
@ -422,10 +416,7 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
|
||||
JERRY_UNREACHABLE (); \
|
||||
} \
|
||||
}
|
||||
|
||||
ECMA_BUILTIN_LIST (DISPATCH_CALL)
|
||||
|
||||
#undef DISPATCH_CALL
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
case ECMA_BUILTIN_ID__COUNT:
|
||||
{
|
||||
@ -469,15 +460,15 @@ ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
|
||||
|
||||
switch (builtin_id)
|
||||
{
|
||||
#define DISPATCH_CONSTRUCT(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case ECMA_BUILTIN_ID_ ## builtin_id: \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
if (ECMA_OBJECT_ ## object_type == ECMA_OBJECT_TYPE_FUNCTION) \
|
||||
if (object_type == ECMA_OBJECT_TYPE_FUNCTION) \
|
||||
{ \
|
||||
return ecma_builtin_ ## lowercase_name ## _dispatch_construct (arguments_list_p, \
|
||||
arguments_list_len); \
|
||||
@ -487,10 +478,7 @@ ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
|
||||
JERRY_UNREACHABLE (); \
|
||||
} \
|
||||
}
|
||||
|
||||
ECMA_BUILTIN_LIST (DISPATCH_CONSTRUCT)
|
||||
|
||||
#undef DISPATCH_CONSTRUCT
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
case ECMA_BUILTIN_ID__COUNT:
|
||||
{
|
||||
@ -526,23 +514,20 @@ ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-i
|
||||
{
|
||||
switch (builtin_object_id)
|
||||
{
|
||||
#define DISPATCH_ROUTINE(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case ECMA_BUILTIN_ID_ ## builtin_id: \
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
return ecma_builtin_ ## lowercase_name ## _dispatch_routine (builtin_routine_id, \
|
||||
this_arg_value, \
|
||||
arguments_list, \
|
||||
arguments_number); \
|
||||
}
|
||||
|
||||
ECMA_BUILTIN_LIST (DISPATCH_ROUTINE)
|
||||
|
||||
#undef DISPATCH_ROUTINE
|
||||
#include "ecma-builtins.inc.h"
|
||||
|
||||
case ECMA_BUILTIN_ID__COUNT:
|
||||
{
|
||||
|
||||
@ -23,42 +23,14 @@
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ECMA_BUILTIN_ID_GLOBAL, /**< the Global object (15.1) */
|
||||
ECMA_BUILTIN_ID_OBJECT, /**< the Object object (15.2.1) */
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, /**< the Object.prototype object (15.2.4) */
|
||||
ECMA_BUILTIN_ID_FUNCTION, /**< the Function object (15.3.1) */
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, /**< the Function.prototype object (15.3.4) */
|
||||
ECMA_BUILTIN_ID_ARRAY, /**< the Array object (15.4.1) */
|
||||
ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, /**< the Array.prototype object (15.4.4) */
|
||||
ECMA_BUILTIN_ID_STRING, /**< the String object (15.5.1) */
|
||||
ECMA_BUILTIN_ID_STRING_PROTOTYPE, /**< the String.prototype object (15.5.4) */
|
||||
ECMA_BUILTIN_ID_BOOLEAN, /**< the Boolean object (15.6.1) */
|
||||
ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE, /**< the Boolean.prototype object (15.6.4) */
|
||||
ECMA_BUILTIN_ID_NUMBER, /**< the Number object (15.7.1) */
|
||||
ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, /**< the Number.prototype object (15.7.4) */
|
||||
ECMA_BUILTIN_ID_DATE, /**< the Date object (15.9.2) */
|
||||
ECMA_BUILTIN_ID_REGEXP, /**< the RegExp object (15.10.3) */
|
||||
ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, /**< the RegExp.prototype object (15.10.6) */
|
||||
ECMA_BUILTIN_ID_ERROR, /**< the Error object (15.11.1) */
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE, /**< the Error.prototype object (15.11.4) */
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR, /**< the EvalError object (15.11.6.1) */
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, /**< the EvalError.prototype object (15.11.6.1) */
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR, /**< the RangeError object (15.11.6.2) */
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, /**< the RangeError.prototype object (15.11.6.2) */
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR, /**< the ReferenceError object (15.11.6.3) */
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, /**< the ReferenceError.prototype object (15.11.6.3) */
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR, /**< the SyntaxError object (15.11.6.4) */
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, /**< the SyntaxError.prototype object (15.11.6.4) */
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR, /**< the TypeError object (15.11.6.5) */
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, /**< the TypeError.prototype object (15.11.6.5) */
|
||||
ECMA_BUILTIN_ID_URI_ERROR, /**< the URIError object (15.11.6.6) */
|
||||
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, /**< the URIError.prototype object (15.11.6.6) */
|
||||
ECMA_BUILTIN_ID_MATH, /**< the Math object (15.8) */
|
||||
ECMA_BUILTIN_ID_JSON, /**< the JSON object (15.12) */
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_THROWER, /**< the [[ThrowTypeError]] object (13.2.3) */
|
||||
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||
ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR, /**< CompactProfileError object defined in the Compact Profile */
|
||||
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||
#define BUILTIN(builtin_id, \
|
||||
object_type, \
|
||||
object_class, \
|
||||
object_prototype_builtin_id, \
|
||||
is_extensible, \
|
||||
lowercase_name) \
|
||||
builtin_id,
|
||||
#include "ecma-builtins.inc.h"
|
||||
ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */
|
||||
} ecma_builtin_id_t;
|
||||
|
||||
|
||||
261
src/libecmabuiltins/ecma-builtins.inc.h
Normal file
261
src/libecmabuiltins/ecma-builtins.inc.h
Normal file
@ -0,0 +1,261 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
/* Description of built-in objects
|
||||
in format (ECMA_BUILTIN_ID_id, object_type, class_magic_string_id, prototype_id, is_extensible, underscored_id) */
|
||||
|
||||
/* The Object.prototype object (15.2.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */,
|
||||
true,
|
||||
object_prototype)
|
||||
|
||||
/* The Function.prototype object (15.3.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
function_prototype)
|
||||
|
||||
/* The Array.prototype object (15.4.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_ARRAY,
|
||||
ECMA_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
array_prototype)
|
||||
|
||||
/* The Array object (15.4.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_STRING_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
string_prototype)
|
||||
|
||||
/* The Boolean.prototype object (15.6.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
boolean_prototype)
|
||||
|
||||
/* The Number.prototype object (15.7.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
number_prototype)
|
||||
|
||||
/* The Object object (15.2.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_OBJECT,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
object)
|
||||
|
||||
/* The Math object (15.8) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_MATH,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_MATH_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
math)
|
||||
|
||||
/* The Array object (15.4.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_ARRAY,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
array)
|
||||
|
||||
/* The String object (15.5.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_STRING,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_STRING_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
string)
|
||||
|
||||
/* The Boolean object (15.6.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_BOOLEAN,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
boolean)
|
||||
|
||||
/* The Number object (15.7.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_NUMBER,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
number)
|
||||
|
||||
/* The Function object (15.3.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_FUNCTION,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
function)
|
||||
|
||||
/* The Error.prototype object (15.11.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
error_prototype)
|
||||
|
||||
/* The Error object (15.11.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
error)
|
||||
|
||||
/* The EvalError.prototype object (15.11.6.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
eval_error_prototype)
|
||||
|
||||
/* The EvalError object (15.11.6.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
true,
|
||||
eval_error)
|
||||
|
||||
/* The RangeError.prototype object (15.11.6.2) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
range_error_prototype)
|
||||
|
||||
/* The RangeError object (15.11.6.2) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
range_error)
|
||||
|
||||
/* The ReferenceError.prototype object (15.11.6.3) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
reference_error_prototype)
|
||||
|
||||
/* The ReferenceError object (15.11.6.3) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
reference_error)
|
||||
|
||||
/* The SyntaxError.prototype object (15.11.6.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
syntax_error_prototype)
|
||||
|
||||
/* The SyntaxError object (15.11.6.4) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
|
||||
true,
|
||||
syntax_error)
|
||||
|
||||
/* The TypeError.prototype object (15.11.6.5) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
type_error_prototype)
|
||||
|
||||
/* The TypeError object (15.11.6.5) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
type_error)
|
||||
|
||||
/* The URIError.prototype object (15.11.6.6) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
uri_error_prototype)
|
||||
|
||||
/* The URIError object (15.11.6.6) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_URI_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
|
||||
true,
|
||||
uri_error)
|
||||
|
||||
/**< The [[ThrowTypeError]] object (13.2.3) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
false,
|
||||
type_error_thrower)
|
||||
|
||||
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||
/* The CompactProfileError object defined in the Compact Profile */
|
||||
BUILTIN (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR,
|
||||
ECMA_OBJECT_TYPE_FUNCTION,
|
||||
ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
false,
|
||||
compact_profile_error)
|
||||
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||
|
||||
/* The Global object (15.1) */
|
||||
BUILTIN (ECMA_BUILTIN_ID_GLOBAL,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */,
|
||||
true,
|
||||
global)
|
||||
|
||||
#undef BUILTIN
|
||||
Loading…
x
Reference in New Issue
Block a user