Throwing CompactProfileError in cases required by Compact Profile.

This commit is contained in:
Ruben Ayrapetyan
2014-10-16 21:25:25 +04:00
parent bd7fd40a32
commit e54023caf2
5 changed files with 180 additions and 1 deletions
@@ -236,7 +236,11 @@ ecma_builtin_function_dispatch_construct (ecma_value_t *arguments_list_p, /**< a
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
#ifdef CONFIG_ECMA_COMPACT_PROFILE
return ecma_make_throw_obj_completion_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR));
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS (arguments_list_p, arguments_list_len);
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
} /* ecma_builtin_function_dispatch_construct */
/**
@@ -93,7 +93,13 @@ JERRY_STATIC_ASSERT (sizeof (ecma_builtin_global_property_names) > sizeof (void*
static ecma_completion_value_t
ecma_builtin_global_object_eval (ecma_value_t x) /**< routine's first argument */
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
(void) x;
return ecma_make_throw_obj_completion_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR));
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS (x);
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
} /* ecma_builtin_global_object_eval */
/**
@@ -555,6 +561,21 @@ ecma_builtin_global_try_to_instantiate_property (ecma_object_t *obj_p, /**< obje
case ECMA_MAGIC_STRING_URI_ERROR_UL:
case ECMA_MAGIC_STRING_JSON_U:
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
/* The object throws CompactProfileError upon invocation */
ecma_object_t *get_set_p = ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR);
ecma_gc_update_may_ref_younger_object_flag_by_object (obj_p, get_set_p);
ecma_property_t *compact_profile_thrower_property_p = ecma_create_named_accessor_property (obj_p,
prop_name_p,
get_set_p,
get_set_p,
true,
false);
ecma_deref_object (get_set_p);
return compact_profile_thrower_property_p;
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ();
}
+1 -1
View File
@@ -125,7 +125,7 @@ ecma_builtin_bin_search_for_magic_string_id_in_array (const ecma_magic_string_id
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, \
function) \
macro (COMPACT_PROFILE_ERROR, \
TYPE_GENERAL, \
TYPE_FUNCTION, \
COMPACT_PROFILE_ERROR_UL, \
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, \
compact_profile_error) \