Remove the ENABLED/DISABLED macros (#4515)
The removal of these macros enabled cppcheck to reveal new errors. These errors are also fixed by the patch. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -343,7 +343,7 @@ ecma_builtin_function_is_routine (ecma_object_t *func_obj_p) /**< function objec
|
||||
return (ext_func_obj_p->u.built_in.routine_id != 0);
|
||||
} /* ecma_builtin_function_is_routine */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
|
||||
/**
|
||||
* Get reference to the realm provided by another built-in object
|
||||
@@ -373,7 +373,7 @@ ecma_builtin_get_realm (ecma_object_t *builtin_object_p) /**< built-in object */
|
||||
return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_global_object_t, realm_value);
|
||||
} /* ecma_builtin_get_realm */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
/**
|
||||
* Instantiate specified ECMA built-in object
|
||||
@@ -394,7 +394,6 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
|
||||
ecma_object_t *prototype_obj_p;
|
||||
|
||||
/* cppcheck-suppress arrayIndexOutOfBoundsCond */
|
||||
if (JERRY_UNLIKELY (object_prototype_builtin_id == ECMA_BUILTIN_ID__COUNT))
|
||||
{
|
||||
prototype_obj_p = NULL;
|
||||
@@ -460,11 +459,11 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
built_in_props_p->routine_id = 0;
|
||||
built_in_props_p->u.length_and_bitset_size = 0;
|
||||
built_in_props_p->u2.instantiated_bitset[0] = 0;
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (built_in_props_p->realm_value, global_object_p);
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#else /* !JERRY_BUILTIN_REALMS */
|
||||
built_in_props_p->continue_instantiated_bitset[0] = 0;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
if (property_count > ECMA_BUILTIN_INSTANTIATED_BITSET_MIN_SIZE)
|
||||
{
|
||||
@@ -478,7 +477,7 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
/** Initializing [[PrimitiveValue]] properties of built-in prototype objects */
|
||||
switch (obj_builtin_id)
|
||||
{
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
#if JERRY_BUILTIN_ARRAY
|
||||
case ECMA_BUILTIN_ID_ARRAY_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_ARRAY);
|
||||
@@ -488,9 +487,9 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
ext_object_p->u.array.length_prop_and_hole_count = ECMA_PROPERTY_FLAG_WRITABLE | ECMA_PROPERTY_VIRTUAL;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
#endif /* JERRY_BUILTIN_ARRAY */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
#if JERRY_BUILTIN_STRING
|
||||
case ECMA_BUILTIN_ID_STRING_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -500,9 +499,9 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
ext_object_p->u.class_prop.u.value = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
#endif /* JERRY_BUILTIN_STRING */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
#if JERRY_BUILTIN_NUMBER
|
||||
case ECMA_BUILTIN_ID_NUMBER_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -512,9 +511,9 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
ext_object_p->u.class_prop.u.value = ecma_make_integer_value (0);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
#endif /* JERRY_BUILTIN_NUMBER */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
#if JERRY_BUILTIN_BOOLEAN
|
||||
case ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -524,10 +523,10 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
ext_object_p->u.class_prop.u.value = ECMA_VALUE_FALSE;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
#endif /* JERRY_BUILTIN_BOOLEAN */
|
||||
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
#if !JERRY_ESNEXT
|
||||
#if JERRY_BUILTIN_DATE
|
||||
case ECMA_BUILTIN_ID_DATE_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -540,9 +539,9 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.class_prop.u.value, prim_prop_num_value_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
#endif /* JERRY_BUILTIN_DATE */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
case ECMA_BUILTIN_ID_REGEXP_PROTOTYPE:
|
||||
{
|
||||
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -559,8 +558,8 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (obj_type != ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -592,11 +591,11 @@ ecma_builtin_create_global_object (void)
|
||||
/* Whenever this assertion fails, the size of extra_instantiated_bitset in ecma_global_object_t
|
||||
* must be increased and 32 must be added to these constants. Furthermore the new uint32 item
|
||||
* must be set to zero. */
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
JERRY_ASSERT (property_count <= ECMA_BUILTIN_INSTANTIATED_BITSET_MIN_SIZE + 64);
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#else /* !JERRY_BUILTIN_REALMS */
|
||||
JERRY_ASSERT (property_count <= ECMA_BUILTIN_INSTANTIATED_BITSET_MIN_SIZE + 32);
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (NULL, sizeof (ecma_global_object_t), obj_type);
|
||||
|
||||
@@ -611,29 +610,29 @@ ecma_builtin_create_global_object (void)
|
||||
global_object_p->extended_object.u.built_in.u.length_and_bitset_size = 0;
|
||||
global_object_p->extended_object.u.built_in.u2.instantiated_bitset[0] = 0;
|
||||
global_object_p->extra_instantiated_bitset[0] = 0;
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (global_object_p->extended_object.u.built_in.realm_value, global_object_p);
|
||||
global_object_p->extra_realms_bitset = 0;
|
||||
global_object_p->this_binding = ecma_make_object_value (object_p);
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#else /* !JERRY_BUILTIN_REALMS */
|
||||
global_object_p->extended_object.u.built_in.continue_instantiated_bitset[0] = 0;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
memset (global_object_p->builtin_objects, 0, (sizeof (jmem_cpointer_t) * ECMA_BUILTIN_OBJECTS_COUNT));
|
||||
|
||||
/* Temporary self reference for GC mark. */
|
||||
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, object_p);
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
global_object_p->global_scope_cp = global_object_p->global_env_cp;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
ecma_object_t *global_lex_env_p = ecma_create_object_lex_env (NULL,
|
||||
object_p,
|
||||
ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, global_lex_env_p);
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
global_object_p->global_scope_cp = global_object_p->global_env_cp;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
ecma_deref_object (global_lex_env_p);
|
||||
|
||||
ecma_object_t *prototype_object_p;
|
||||
@@ -669,7 +668,7 @@ ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, *builtin_p);
|
||||
} /* ecma_builtin_get */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
|
||||
/**
|
||||
* Get reference to specified built-in object using the realm provided by another built-in object
|
||||
@@ -695,7 +694,7 @@ ecma_builtin_get_from_realm (ecma_global_object_t *global_object_p, /**< global
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, *builtin_p);
|
||||
} /* ecma_builtin_get_from_realm */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
/**
|
||||
* Get reference to specified built-in object using the realm provided by another built-in object
|
||||
@@ -711,12 +710,12 @@ ecma_builtin_get_from_builtin (ecma_object_t *builtin_object_p, /**< built-in ob
|
||||
{
|
||||
JERRY_ASSERT (builtin_id < ECMA_BUILTIN_OBJECTS_COUNT);
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
return ecma_builtin_get_from_realm (ecma_builtin_get_realm (builtin_object_p), builtin_id);
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#else /* !JERRY_BUILTIN_REALMS */
|
||||
JERRY_UNUSED (builtin_object_p);
|
||||
return ecma_builtin_get (builtin_id);
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
} /* ecma_builtin_get_from_builtin */
|
||||
|
||||
/**
|
||||
@@ -764,9 +763,9 @@ ecma_builtin_make_function_object_for_routine (ecma_object_t *builtin_object_p,
|
||||
ext_func_obj_p->u.built_in.u.routine_index = (uint8_t) routine_index;
|
||||
ext_func_obj_p->u.built_in.u2.routine_flags = flags;
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
ext_func_obj_p->u.built_in.realm_value = built_in_props_p->realm_value;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
return func_obj_p;
|
||||
} /* ecma_builtin_make_function_object_for_routine */
|
||||
@@ -807,7 +806,7 @@ ecma_builtin_make_function_object_for_setter_accessor (ecma_object_t *builtin_ob
|
||||
ECMA_BUILTIN_ROUTINE_SETTER);
|
||||
} /* ecma_builtin_make_function_object_for_setter_accessor */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Create specification defined properties for built-in native handlers.
|
||||
@@ -858,7 +857,7 @@ ecma_builtin_native_handler_try_to_instantiate_property (ecma_object_t *object_p
|
||||
return prop_p;
|
||||
} /* ecma_builtin_native_handler_try_to_instantiate_property */
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Lazy instantiation of builtin routine property of builtin object
|
||||
@@ -879,12 +878,12 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
|
||||
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
|
||||
{
|
||||
return ecma_builtin_native_handler_try_to_instantiate_property (object_p, string_p);
|
||||
}
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
if (ecma_string_is_length (string_p))
|
||||
{
|
||||
@@ -893,7 +892,7 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
|
||||
*/
|
||||
ecma_property_t *len_prop_p;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
uint8_t *bitset_p = &ext_func_p->u.built_in.u2.routine_flags;
|
||||
|
||||
if (*bitset_p & ECMA_BUILTIN_ROUTINE_LENGTH_INITIALIZED)
|
||||
@@ -909,14 +908,14 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
|
||||
string_p,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE,
|
||||
&len_prop_p);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
/* We don't need to mark that the property was already lazy instantiated,
|
||||
* as it is non-configurable and so can't be deleted (ECMA-262 v5, 13.2.5) */
|
||||
ecma_property_value_t *len_prop_value_p = ecma_create_named_data_property (object_p,
|
||||
string_p,
|
||||
ECMA_PROPERTY_FIXED,
|
||||
&len_prop_p);
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
uint8_t length = 0;
|
||||
|
||||
@@ -940,7 +939,7 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
|
||||
return len_prop_p;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
/*
|
||||
* Lazy instantiation of 'name' property
|
||||
*/
|
||||
@@ -1016,7 +1015,7 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
|
||||
|
||||
return name_prop_p;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
return NULL;
|
||||
} /* ecma_builtin_routine_try_to_instantiate_property */
|
||||
@@ -1037,7 +1036,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
|
||||
lit_magic_string_id_t magic_string_id = ecma_get_string_magic (string_p);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (string_p)))
|
||||
{
|
||||
if (string_p->u.hash & ECMA_GLOBAL_SYMBOL_FLAG)
|
||||
@@ -1045,7 +1044,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
magic_string_id = (string_p->u.hash >> ECMA_GLOBAL_SYMBOL_SHIFT);
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
if (magic_string_id == LIT_MAGIC_STRING__COUNT)
|
||||
{
|
||||
@@ -1085,12 +1084,12 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
uint32_t index = (uint32_t) (curr_property_p - property_list_p);
|
||||
uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + (index >> 3);
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
if (index >= 8 * sizeof (uint8_t))
|
||||
{
|
||||
bitset_p += sizeof (ecma_value_t);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
uint8_t bit_for_index = (uint8_t) (1u << (index & 0x7));
|
||||
|
||||
@@ -1113,7 +1112,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
{
|
||||
value = curr_property_p->value;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (value == ECMA_VALUE_GLOBAL_THIS)
|
||||
{
|
||||
/* Only the global object has globalThis property. */
|
||||
@@ -1121,7 +1120,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
ecma_ref_object (object_p);
|
||||
value = ecma_make_object_value (object_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
break;
|
||||
}
|
||||
case ECMA_BUILTIN_PROPERTY_NUMBER:
|
||||
@@ -1138,11 +1137,11 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
{
|
||||
ECMA_NUMBER_MAX_VALUE,
|
||||
ECMA_NUMBER_MIN_VALUE,
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
ECMA_NUMBER_EPSILON,
|
||||
ECMA_NUMBER_MAX_SAFE_INTEGER,
|
||||
ECMA_NUMBER_MIN_SAFE_INTEGER,
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
ECMA_NUMBER_E,
|
||||
ECMA_NUMBER_PI,
|
||||
ECMA_NUMBER_LN10,
|
||||
@@ -1187,7 +1186,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
value = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->value);
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
case ECMA_BUILTIN_PROPERTY_SYMBOL:
|
||||
{
|
||||
lit_magic_string_id_t symbol_id = (lit_magic_string_id_t) curr_property_p->value;
|
||||
@@ -1212,7 +1211,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
ecma_ref_object (setter_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
case ECMA_BUILTIN_PROPERTY_OBJECT:
|
||||
{
|
||||
ecma_object_t *builtin_object_p;
|
||||
@@ -1286,7 +1285,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
return prop_p;
|
||||
} /* ecma_builtin_try_to_instantiate_property */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* List names of an Built-in native handler object's lazy instantiated properties,
|
||||
@@ -1314,7 +1313,7 @@ ecma_builtin_native_handler_list_lazy_property_names (ecma_object_t *object_p, /
|
||||
}
|
||||
} /* ecma_builtin_native_handler_list_lazy_property_names */
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* List names of a built-in function's lazy instantiated properties
|
||||
@@ -1331,7 +1330,7 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
|
||||
JERRY_ASSERT (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_NATIVE_FUNCTION);
|
||||
JERRY_ASSERT (ecma_builtin_function_is_routine (object_p));
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
|
||||
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
|
||||
@@ -1352,11 +1351,11 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
|
||||
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME));
|
||||
prop_counter_p->string_named_props++;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
/* 'length' property is non-enumerable (ECMA-262 v5, 15) */
|
||||
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
|
||||
prop_counter_p->string_named_props++;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
} /* ecma_builtin_routine_list_lazy_property_names */
|
||||
|
||||
/**
|
||||
@@ -1395,11 +1394,11 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
|
||||
uint32_t index = 0;
|
||||
uint8_t bitset = built_in_props_p->u2.instantiated_bitset[0];
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
#if JERRY_BUILTIN_REALMS
|
||||
uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + 1 + sizeof (ecma_value_t);
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#else /* !JERRY_BUILTIN_REALMS */
|
||||
uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + 1;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
#endif /* JERRY_BUILTIN_REALMS */
|
||||
|
||||
while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT)
|
||||
{
|
||||
@@ -1413,7 +1412,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
|
||||
|
||||
if (curr_property_p->magic_string_id > LIT_NON_INTERNAL_MAGIC_STRING__COUNT)
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (LIT_IS_GLOBAL_SYMBOL (curr_property_p->magic_string_id))
|
||||
{
|
||||
ecma_string_t *name_p = ecma_op_get_global_symbol (curr_property_p->magic_string_id);
|
||||
@@ -1429,7 +1428,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
|
||||
ecma_deref_ecma_string (name_p);
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1511,13 +1510,13 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
|
||||
|
||||
if (ecma_builtin_function_is_routine (obj_p))
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (JERRY_UNLIKELY (ext_obj_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
|
||||
{
|
||||
ecma_native_handler_t handler = ecma_builtin_handler_get (ext_obj_p->u.built_in.routine_id);
|
||||
return handler (ecma_make_object_value (obj_p), this_arg_value, arguments_list_p, arguments_list_len);
|
||||
}
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
return ecma_builtin_dispatch_routine (ext_obj_p,
|
||||
this_arg_value,
|
||||
|
||||
Reference in New Issue
Block a user