Improve magic string handling. (#2221)
Remove unnecessary ref / deref calls when magic strings are used. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -353,9 +353,9 @@ ecma_op_array_list_lazy_property_names (ecma_object_t *obj_p, /**< a String obje
|
||||
|
||||
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
|
||||
|
||||
ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (length_str_p), 0);
|
||||
ecma_deref_ecma_string (length_str_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH),
|
||||
0);
|
||||
} /* ecma_op_array_list_lazy_property_names */
|
||||
|
||||
/**
|
||||
|
||||
@@ -519,24 +519,20 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
/* a. */
|
||||
prop_desc.value = src_prop_desc_p->value;
|
||||
|
||||
ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
value_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_VALUE),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (value_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
/* b. */
|
||||
const bool is_writable = (src_prop_desc_p->is_writable);
|
||||
prop_desc.value = ecma_make_boolean_value (is_writable);
|
||||
|
||||
ecma_string_t *writable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
writable_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (writable_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
}
|
||||
else
|
||||
@@ -555,12 +551,10 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p);
|
||||
}
|
||||
|
||||
ecma_string_t *get_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GET);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
get_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_GET),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (get_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
/* b. */
|
||||
@@ -573,35 +567,29 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p);
|
||||
}
|
||||
|
||||
ecma_string_t *set_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SET);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
set_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_SET),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (set_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
}
|
||||
|
||||
const bool is_enumerable = src_prop_desc_p->is_enumerable;
|
||||
prop_desc.value = ecma_make_boolean_value (is_enumerable);
|
||||
|
||||
ecma_string_t *enumerable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
enumerable_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (enumerable_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
const bool is_configurable = src_prop_desc_p->is_configurable;
|
||||
prop_desc.value = ecma_make_boolean_value (is_configurable);
|
||||
|
||||
ecma_string_t *configurable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
configurable_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE),
|
||||
&prop_desc,
|
||||
false);
|
||||
ecma_deref_ecma_string (configurable_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
return obj_p;
|
||||
@@ -637,10 +625,8 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
|
||||
/* 3. */
|
||||
ecma_string_t *enumerable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE);
|
||||
|
||||
ECMA_TRY_CATCH (enumerable_prop_value,
|
||||
ecma_op_object_find (obj_p, enumerable_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (enumerable_prop_value))
|
||||
@@ -651,17 +637,13 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
|
||||
ECMA_FINALIZE (enumerable_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (enumerable_magic_string_p);
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
/* 4. */
|
||||
ecma_string_t *configurable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE);
|
||||
|
||||
ECMA_TRY_CATCH (configurable_prop_value,
|
||||
ecma_op_object_find (obj_p, configurable_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (configurable_prop_value))
|
||||
@@ -671,8 +653,6 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (configurable_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (configurable_magic_string_p);
|
||||
}
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
@@ -680,10 +660,8 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
/* 5. */
|
||||
ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
|
||||
|
||||
ECMA_TRY_CATCH (value_prop_value,
|
||||
ecma_op_object_find (obj_p, value_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_VALUE)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (value_prop_value))
|
||||
@@ -693,8 +671,6 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (value_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (value_magic_string_p);
|
||||
}
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
@@ -702,10 +678,8 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
/* 6. */
|
||||
ecma_string_t *writable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE);
|
||||
|
||||
ECMA_TRY_CATCH (writable_prop_value,
|
||||
ecma_op_object_find (obj_p, writable_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (writable_prop_value))
|
||||
@@ -715,8 +689,6 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (writable_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (writable_magic_string_p);
|
||||
}
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
@@ -724,10 +696,8 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
/* 7. */
|
||||
ecma_string_t *get_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GET);
|
||||
|
||||
ECMA_TRY_CATCH (get_prop_value,
|
||||
ecma_op_object_find (obj_p, get_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_GET)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (get_prop_value))
|
||||
@@ -758,8 +728,6 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (get_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (get_magic_string_p);
|
||||
}
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
@@ -767,10 +735,8 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
/* 8. */
|
||||
ecma_string_t *set_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SET);
|
||||
|
||||
ECMA_TRY_CATCH (set_prop_value,
|
||||
ecma_op_object_find (obj_p, set_magic_string_p),
|
||||
ecma_op_object_find (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_SET)),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_found (set_prop_value))
|
||||
@@ -801,8 +767,6 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (set_prop_value);
|
||||
|
||||
ecma_deref_ecma_string (set_magic_string_p);
|
||||
}
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
|
||||
@@ -175,14 +175,11 @@ ecma_new_standard_error_with_message (ecma_standard_error_t error_type, /**< nat
|
||||
{
|
||||
ecma_object_t *new_error_obj_p = ecma_new_standard_error (error_type);
|
||||
|
||||
ecma_string_t *message_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MESSAGE);
|
||||
|
||||
ecma_property_value_t *prop_value_p;
|
||||
prop_value_p = ecma_create_named_data_property (new_error_obj_p,
|
||||
message_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_MESSAGE),
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
|
||||
NULL);
|
||||
ecma_deref_ecma_string (message_magic_string_p);
|
||||
|
||||
ecma_ref_ecma_string (message_string_p);
|
||||
prop_value_p->value = ecma_make_string_value (message_string_p);
|
||||
@@ -262,6 +259,7 @@ ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, /**< er
|
||||
/* Convert an argument to string without side effects. */
|
||||
ecma_string_t *arg_string_p;
|
||||
const ecma_value_t arg_val = va_arg (args, ecma_value_t);
|
||||
|
||||
if (unlikely (ecma_is_value_object (arg_val)))
|
||||
{
|
||||
ecma_object_t *arg_object_p = ecma_get_object_from_value (arg_val);
|
||||
|
||||
@@ -952,14 +952,14 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
|
||||
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
|
||||
|
||||
/* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
ecma_string_t *name_p = ecma_new_ecma_length_string ();
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH),
|
||||
0);
|
||||
|
||||
/* 'prototype' property is non-enumerable (ECMA-262 v5, 13.2.18) */
|
||||
name_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_PROTOTYPE),
|
||||
0);
|
||||
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
|
||||
@@ -970,14 +970,14 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
|
||||
{
|
||||
/* 'caller' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
name_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER),
|
||||
0);
|
||||
|
||||
/* 'arguments' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
name_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_ARGUMENTS),
|
||||
0);
|
||||
}
|
||||
} /* ecma_op_function_list_lazy_property_names */
|
||||
|
||||
@@ -1007,9 +1007,9 @@ ecma_op_external_function_list_lazy_property_names (bool separate_enumerable, /*
|
||||
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
|
||||
|
||||
/* 'prototype' property is non-enumerable (ECMA-262 v5, 13.2.18) */
|
||||
ecma_string_t *name_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_PROTOTYPE),
|
||||
0);
|
||||
} /* ecma_op_external_function_list_lazy_property_names */
|
||||
|
||||
/**
|
||||
@@ -1039,19 +1039,19 @@ ecma_op_bound_function_list_lazy_property_names (bool separate_enumerable, /**<
|
||||
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
|
||||
|
||||
/* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
ecma_string_t *name_p = ecma_new_ecma_length_string ();
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH),
|
||||
0);
|
||||
|
||||
/* 'caller' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
name_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER),
|
||||
0);
|
||||
|
||||
/* 'arguments' property is non-enumerable (ECMA-262 v5, 13.2.5) */
|
||||
name_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), 0);
|
||||
ecma_deref_ecma_string (name_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_ARGUMENTS),
|
||||
0);
|
||||
} /* ecma_op_bound_function_list_lazy_property_names */
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,15 +145,15 @@ ecma_process_promise_reaction_job (void *obj_p) /**< the job to be operated */
|
||||
ecma_job_promise_reaction_t *job_p = (ecma_job_promise_reaction_t *) obj_p;
|
||||
ecma_object_t *reaction_p = ecma_get_object_from_value (job_p->reaction);
|
||||
|
||||
ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *str_handler = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
|
||||
ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
ecma_string_t *capability_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *handler_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
|
||||
ecma_string_t *resolve_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_string_t *reject_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
|
||||
/* 2. */
|
||||
ecma_value_t capability = ecma_op_object_get (reaction_p, str_capability);
|
||||
ecma_value_t capability = ecma_op_object_get (reaction_p, capability_str_p);
|
||||
/* 3. */
|
||||
ecma_value_t handler = ecma_op_object_get (reaction_p, str_handler);
|
||||
ecma_value_t handler = ecma_op_object_get (reaction_p, handler_str_p);
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_boolean (handler) || ecma_op_is_callable (handler));
|
||||
|
||||
@@ -183,7 +183,7 @@ ecma_process_promise_reaction_job (void *obj_p) /**< the job to be operated */
|
||||
}
|
||||
|
||||
/* 7. */
|
||||
ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), str_reject);
|
||||
ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), reject_str_p);
|
||||
|
||||
JERRY_ASSERT (ecma_op_is_callable (reject));
|
||||
|
||||
@@ -196,7 +196,7 @@ ecma_process_promise_reaction_job (void *obj_p) /**< the job to be operated */
|
||||
else
|
||||
{
|
||||
/* 8. */
|
||||
ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), str_resolve);
|
||||
ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), resolve_str_p);
|
||||
|
||||
JERRY_ASSERT (ecma_op_is_callable (resolve));
|
||||
|
||||
@@ -210,10 +210,6 @@ ecma_process_promise_reaction_job (void *obj_p) /**< the job to be operated */
|
||||
ecma_free_value (handler_result);
|
||||
ecma_free_value (handler);
|
||||
ecma_free_value (capability);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
ecma_deref_ecma_string (str_handler);
|
||||
ecma_deref_ecma_string (str_resolve);
|
||||
ecma_deref_ecma_string (str_reject);
|
||||
ecma_free_promise_reaction_job (job_p);
|
||||
|
||||
return status;
|
||||
|
||||
@@ -115,49 +115,41 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
ecma_property_value_t *prop_value_p;
|
||||
|
||||
/* 11.a, 11.b */
|
||||
for (ecma_length_t indx = 0;
|
||||
indx < arguments_number;
|
||||
indx++)
|
||||
for (ecma_length_t index = 0;
|
||||
index < arguments_number;
|
||||
index++)
|
||||
{
|
||||
ecma_string_t *indx_string_p = ecma_new_ecma_string_from_uint32 (indx);
|
||||
ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
|
||||
|
||||
prop_value_p = ecma_create_named_data_property (obj_p,
|
||||
indx_string_p,
|
||||
index_string_p,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
|
||||
NULL);
|
||||
|
||||
prop_value_p->value = ecma_copy_value_if_not_object (arguments_list_p[indx]);
|
||||
prop_value_p->value = ecma_copy_value_if_not_object (arguments_list_p[index]);
|
||||
|
||||
ecma_deref_ecma_string (indx_string_p);
|
||||
ecma_deref_ecma_string (index_string_p);
|
||||
}
|
||||
|
||||
/* 7. */
|
||||
ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
|
||||
|
||||
prop_value_p = ecma_create_named_data_property (obj_p,
|
||||
length_magic_string_p,
|
||||
ecma_get_length_string (),
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
|
||||
NULL);
|
||||
|
||||
prop_value_p->value = ecma_make_uint32_value (arguments_number);
|
||||
|
||||
ecma_deref_ecma_string (length_magic_string_p);
|
||||
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
|
||||
/* 13. */
|
||||
if (!is_strict)
|
||||
{
|
||||
ecma_string_t *callee_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE);
|
||||
|
||||
prop_value_p = ecma_create_named_data_property (obj_p,
|
||||
callee_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE),
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
|
||||
NULL);
|
||||
|
||||
prop_value_p->value = ecma_make_object_value (func_obj_p);
|
||||
|
||||
ecma_deref_ecma_string (callee_magic_string_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -179,23 +171,18 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
prop_desc.is_configurable = false;
|
||||
}
|
||||
|
||||
ecma_string_t *callee_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE);
|
||||
|
||||
ecma_value_t completion = ecma_op_object_define_own_property (obj_p,
|
||||
callee_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE),
|
||||
&prop_desc,
|
||||
false);
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
ecma_deref_ecma_string (callee_magic_string_p);
|
||||
|
||||
ecma_string_t *caller_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
|
||||
completion = ecma_op_object_define_own_property (obj_p,
|
||||
caller_magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_CALLER),
|
||||
&prop_desc,
|
||||
false);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
ecma_deref_ecma_string (caller_magic_string_p);
|
||||
|
||||
ecma_deref_object (thrower_p);
|
||||
}
|
||||
@@ -223,7 +210,6 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
JERRY_ASSERT (ecma_is_value_empty (completion));
|
||||
}
|
||||
|
||||
ecma_deref_ecma_string (arguments_string_p);
|
||||
ecma_deref_object (obj_p);
|
||||
} /* ecma_op_create_arguments_object */
|
||||
|
||||
|
||||
@@ -362,55 +362,46 @@ ecma_call_builtin_executor (ecma_object_t *executor_p, /**< the executor object
|
||||
ecma_value_t resolve_func, /**< the resolve function */
|
||||
ecma_value_t reject_func) /**< the reject function */
|
||||
{
|
||||
ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
ecma_string_t *capability_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *resolve_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_string_t *reject_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
|
||||
/* 2. */
|
||||
ecma_value_t capability = ecma_op_object_get (executor_p, str_capability);
|
||||
ecma_value_t capability = ecma_op_object_get (executor_p, capability_str_p);
|
||||
/* 3. */
|
||||
ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), str_resolve);
|
||||
ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), resolve_str_p);
|
||||
|
||||
if (resolve != ECMA_VALUE_UNDEFINED)
|
||||
{
|
||||
ecma_free_value (resolve);
|
||||
ecma_free_value (capability);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
ecma_deref_ecma_string (str_resolve);
|
||||
ecma_deref_ecma_string (str_reject);
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'resolve' function should be undefined."));
|
||||
}
|
||||
|
||||
/* 4. */
|
||||
ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), str_reject);
|
||||
ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), reject_str_p);
|
||||
|
||||
if (reject != ECMA_VALUE_UNDEFINED)
|
||||
{
|
||||
ecma_free_value (reject);
|
||||
ecma_free_value (capability);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
ecma_deref_ecma_string (str_resolve);
|
||||
ecma_deref_ecma_string (str_reject);
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'reject' function should be undefined."));
|
||||
}
|
||||
|
||||
/* 5. */
|
||||
ecma_op_object_put (ecma_get_object_from_value (capability),
|
||||
str_resolve,
|
||||
resolve_str_p,
|
||||
resolve_func,
|
||||
false);
|
||||
/* 6. */
|
||||
ecma_op_object_put (ecma_get_object_from_value (capability),
|
||||
str_reject,
|
||||
reject_str_p,
|
||||
reject_func,
|
||||
false);
|
||||
|
||||
ecma_free_value (capability);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
ecma_deref_ecma_string (str_resolve);
|
||||
ecma_deref_ecma_string (str_reject);
|
||||
|
||||
return ECMA_VALUE_UNDEFINED;
|
||||
} /* ecma_call_builtin_executor */
|
||||
@@ -593,15 +584,16 @@ ecma_promise_new_capability (void)
|
||||
{
|
||||
/* 3. */
|
||||
ecma_object_t *capability_p = ecma_op_create_object_object_noarg ();
|
||||
ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
|
||||
|
||||
ecma_string_t *capability_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *promise_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
|
||||
/* 4. */
|
||||
ecma_object_t *executor_p;
|
||||
executor_p = ecma_op_create_object_object_noarg ();
|
||||
ecma_value_t executor = ecma_make_object_value (executor_p);
|
||||
/* 5. */
|
||||
ecma_op_object_put (executor_p,
|
||||
str_capability,
|
||||
capability_str_p,
|
||||
ecma_make_object_value (capability_p),
|
||||
false);
|
||||
|
||||
@@ -610,13 +602,12 @@ ecma_promise_new_capability (void)
|
||||
|
||||
/* 10. */
|
||||
ecma_op_object_put (capability_p,
|
||||
str_promise,
|
||||
promise_str_p,
|
||||
promise,
|
||||
false);
|
||||
|
||||
ecma_deref_object (executor_p);
|
||||
ecma_deref_ecma_string (str_promise);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
|
||||
/* 7. */
|
||||
if (ECMA_IS_VALUE_ERROR (promise))
|
||||
{
|
||||
@@ -627,9 +618,8 @@ ecma_promise_new_capability (void)
|
||||
|
||||
ecma_free_value (promise);
|
||||
/* 8. */
|
||||
ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_value_t resolve = ecma_op_object_get (capability_p, str_resolve);
|
||||
ecma_deref_ecma_string (str_resolve);
|
||||
ecma_string_t *resolve_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
|
||||
ecma_value_t resolve = ecma_op_object_get (capability_p, resolve_str_p);
|
||||
|
||||
if (!ecma_op_is_callable (resolve))
|
||||
{
|
||||
@@ -640,9 +630,8 @@ ecma_promise_new_capability (void)
|
||||
|
||||
ecma_free_value (resolve);
|
||||
/* 9. */
|
||||
ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
ecma_value_t reject = ecma_op_object_get (capability_p, str_reject);
|
||||
ecma_deref_ecma_string (str_reject);
|
||||
ecma_string_t *reject_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
|
||||
ecma_value_t reject = ecma_op_object_get (capability_p, reject_str_p);
|
||||
|
||||
if (!ecma_op_is_callable (reject))
|
||||
{
|
||||
@@ -671,9 +660,9 @@ ecma_promise_do_then (ecma_value_t promise, /**< the promise which call 'then' *
|
||||
ecma_value_t on_rejected, /**< on_rejected function */
|
||||
ecma_value_t result_capability) /**< promise capability */
|
||||
{
|
||||
ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *str_handler = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
|
||||
ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
|
||||
ecma_string_t *capability_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
|
||||
ecma_string_t *handler_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
|
||||
ecma_string_t *promise_str_p = ecma_get_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
|
||||
|
||||
/* 3. boolean true indicates "indentity" */
|
||||
if (!ecma_op_is_callable (on_fulfilled))
|
||||
@@ -691,20 +680,20 @@ ecma_promise_do_then (ecma_value_t promise, /**< the promise which call 'then' *
|
||||
ecma_object_t *fulfill_reaction_p = ecma_op_create_object_object_noarg ();
|
||||
ecma_object_t *reject_reaction_p = ecma_op_create_object_object_noarg ();
|
||||
ecma_op_object_put (fulfill_reaction_p,
|
||||
str_capability,
|
||||
capability_str_p,
|
||||
result_capability,
|
||||
false);
|
||||
ecma_op_object_put (fulfill_reaction_p,
|
||||
str_handler,
|
||||
handler_str_p,
|
||||
on_fulfilled,
|
||||
false);
|
||||
|
||||
ecma_op_object_put (reject_reaction_p,
|
||||
str_capability,
|
||||
capability_str_p,
|
||||
result_capability,
|
||||
false);
|
||||
ecma_op_object_put (reject_reaction_p,
|
||||
str_handler,
|
||||
handler_str_p,
|
||||
on_rejected,
|
||||
false);
|
||||
|
||||
@@ -738,13 +727,10 @@ ecma_promise_do_then (ecma_value_t promise, /**< the promise which call 'then' *
|
||||
}
|
||||
|
||||
/* 10. */
|
||||
ecma_value_t ret = ecma_op_object_get (ecma_get_object_from_value (result_capability), str_promise);
|
||||
ecma_value_t ret = ecma_op_object_get (ecma_get_object_from_value (result_capability), promise_str_p);
|
||||
|
||||
ecma_deref_object (fulfill_reaction_p);
|
||||
ecma_deref_object (reject_reaction_p);
|
||||
ecma_deref_ecma_string (str_capability);
|
||||
ecma_deref_ecma_string (str_handler);
|
||||
ecma_deref_ecma_string (str_promise);
|
||||
return ret;
|
||||
} /* ecma_promise_do_then */
|
||||
|
||||
|
||||
@@ -164,47 +164,35 @@ re_initialize_props (ecma_object_t *re_obj_p, /**< RegExp object */
|
||||
ecma_string_t *source_p, /**< source string */
|
||||
uint16_t flags) /**< flags */
|
||||
{
|
||||
/* Set source property. ECMA-262 v5, 15.10.7.1 */
|
||||
ecma_string_t *magic_string_p;
|
||||
|
||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
|
||||
/* Set source property. ECMA-262 v5, 15.10.7.1 */
|
||||
re_set_data_property (re_obj_p,
|
||||
magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE),
|
||||
ECMA_PROPERTY_FIXED,
|
||||
ecma_make_string_value (source_p));
|
||||
ecma_deref_ecma_string (magic_string_p);
|
||||
|
||||
/* Set global property. ECMA-262 v5, 15.10.7.2 */
|
||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
|
||||
re_set_data_property (re_obj_p,
|
||||
magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL),
|
||||
ECMA_PROPERTY_FIXED,
|
||||
ecma_make_boolean_value (flags & RE_FLAG_GLOBAL));
|
||||
ecma_deref_ecma_string (magic_string_p);
|
||||
|
||||
/* Set ignoreCase property. ECMA-262 v5, 15.10.7.3 */
|
||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
|
||||
re_set_data_property (re_obj_p,
|
||||
magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL),
|
||||
ECMA_PROPERTY_FIXED,
|
||||
ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE));
|
||||
ecma_deref_ecma_string (magic_string_p);
|
||||
|
||||
/* Set multiline property. ECMA-262 v5, 15.10.7.4 */
|
||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
|
||||
re_set_data_property (re_obj_p,
|
||||
magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE),
|
||||
ECMA_PROPERTY_FIXED,
|
||||
ecma_make_boolean_value (flags & RE_FLAG_MULTILINE));
|
||||
ecma_deref_ecma_string (magic_string_p);
|
||||
|
||||
/* Set lastIndex property. ECMA-262 v5, 15.10.7.5 */
|
||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
|
||||
re_set_data_property (re_obj_p,
|
||||
magic_string_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
|
||||
ECMA_PROPERTY_FLAG_WRITABLE,
|
||||
ecma_make_integer_value (0));
|
||||
ecma_deref_ecma_string (magic_string_p);
|
||||
} /* re_initialize_props */
|
||||
|
||||
/**
|
||||
@@ -1172,33 +1160,24 @@ re_set_result_array_properties (ecma_object_t *array_obj_p, /**< result array */
|
||||
int32_t index) /**< index of matching */
|
||||
{
|
||||
/* Set index property of the result array */
|
||||
ecma_string_t *result_prop_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
|
||||
{
|
||||
ecma_builtin_helper_def_prop (array_obj_p,
|
||||
result_prop_str_p,
|
||||
ecma_make_int32_value (index),
|
||||
true, /* Writable */
|
||||
true, /* Enumerable */
|
||||
true, /* Configurable */
|
||||
true); /* Failure handling */
|
||||
}
|
||||
ecma_deref_ecma_string (result_prop_str_p);
|
||||
ecma_builtin_helper_def_prop (array_obj_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_INDEX),
|
||||
ecma_make_int32_value (index),
|
||||
true, /* Writable */
|
||||
true, /* Enumerable */
|
||||
true, /* Configurable */
|
||||
true); /* Failure handling */
|
||||
|
||||
/* Set input property of the result array */
|
||||
result_prop_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INPUT);
|
||||
|
||||
ecma_builtin_helper_def_prop (array_obj_p,
|
||||
result_prop_str_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_INPUT),
|
||||
ecma_make_string_value (input_str_p),
|
||||
true, /* Writable */
|
||||
true, /* Enumerable */
|
||||
true, /* Configurable */
|
||||
true); /* Failure handling */
|
||||
|
||||
ecma_deref_ecma_string (result_prop_str_p);
|
||||
|
||||
/* Set length property of the result array */
|
||||
result_prop_str_p = ecma_new_ecma_length_string ();
|
||||
{
|
||||
ecma_property_descriptor_t array_item_prop_desc = ecma_make_empty_property_descriptor ();
|
||||
array_item_prop_desc.is_value_defined = true;
|
||||
@@ -1206,11 +1185,10 @@ re_set_result_array_properties (ecma_object_t *array_obj_p, /**< result array */
|
||||
array_item_prop_desc.value = ecma_make_uint32_value (num_of_elements);
|
||||
|
||||
ecma_op_object_define_own_property (array_obj_p,
|
||||
result_prop_str_p,
|
||||
ecma_get_length_string (),
|
||||
&array_item_prop_desc,
|
||||
true);
|
||||
}
|
||||
ecma_deref_ecma_string (result_prop_str_p);
|
||||
} /* re_set_result_array_properties */
|
||||
|
||||
/**
|
||||
@@ -1321,8 +1299,6 @@ ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (lastindex_num);
|
||||
|
||||
ecma_fast_free_value (lastindex_value);
|
||||
|
||||
ecma_deref_ecma_string (magic_str_p);
|
||||
}
|
||||
|
||||
/* 2. Try to match */
|
||||
@@ -1335,9 +1311,10 @@ ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
|
||||
{
|
||||
if (re_ctx.flags & RE_FLAG_GLOBAL)
|
||||
{
|
||||
ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
|
||||
ecma_op_object_put (regexp_object_p, magic_str_p, ecma_make_integer_value (0), true);
|
||||
ecma_deref_ecma_string (magic_str_p);
|
||||
ecma_op_object_put (regexp_object_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
|
||||
ecma_make_integer_value (0),
|
||||
true);
|
||||
}
|
||||
|
||||
is_match = false;
|
||||
@@ -1369,7 +1346,6 @@ ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
|
||||
|
||||
if (input_curr_p && (re_ctx.flags & RE_FLAG_GLOBAL))
|
||||
{
|
||||
ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
|
||||
ecma_number_t lastindex_num;
|
||||
|
||||
if (sub_str_p != NULL
|
||||
@@ -1383,8 +1359,10 @@ ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
|
||||
lastindex_num = ECMA_NUMBER_ZERO;
|
||||
}
|
||||
|
||||
ecma_op_object_put (regexp_object_p, magic_str_p, ecma_make_number_value (lastindex_num), true);
|
||||
ecma_deref_ecma_string (magic_str_p);
|
||||
ecma_op_object_put (regexp_object_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
|
||||
ecma_make_number_value (lastindex_num),
|
||||
true);
|
||||
}
|
||||
|
||||
/* 3. Fill the result array or return with 'undefiend' */
|
||||
|
||||
@@ -46,27 +46,18 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
JERRY_ASSERT (arguments_list_len == 0
|
||||
|| arguments_list_p != NULL);
|
||||
|
||||
ecma_string_t *prim_prop_str_value_p;
|
||||
ecma_value_t prim_value = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
|
||||
if (arguments_list_len == 0)
|
||||
if (arguments_list_len > 0)
|
||||
{
|
||||
prim_prop_str_value_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING__EMPTY);
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_value_t to_str_arg_value = ecma_op_to_string (arguments_list_p[0]);
|
||||
prim_value = ecma_op_to_string (arguments_list_p[0]);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (to_str_arg_value))
|
||||
if (ECMA_IS_VALUE_ERROR (prim_value))
|
||||
{
|
||||
return to_str_arg_value;
|
||||
return prim_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_str_arg_value));
|
||||
JERRY_ASSERT (ecma_is_value_string (to_str_arg_value));
|
||||
|
||||
prim_prop_str_value_p = ecma_get_string_from_value (to_str_arg_value);
|
||||
}
|
||||
JERRY_ASSERT (ecma_is_value_string (prim_value));
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
@@ -83,7 +74,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
|
||||
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
|
||||
ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_STRING_UL;
|
||||
ext_object_p->u.class_prop.u.value = ecma_make_string_value (prim_prop_str_value_p);
|
||||
ext_object_p->u.class_prop.u.value = prim_value;
|
||||
|
||||
return ecma_make_object_value (object_p);
|
||||
} /* ecma_op_create_string_object */
|
||||
@@ -131,9 +122,9 @@ ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p, /**< a String obj
|
||||
ecma_deref_ecma_string (name_p);
|
||||
}
|
||||
|
||||
ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
|
||||
ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (length_str_p), 0);
|
||||
ecma_deref_ecma_string (length_str_p);
|
||||
ecma_append_to_values_collection (for_non_enumerable_p,
|
||||
ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH),
|
||||
0);
|
||||
} /* ecma_op_string_list_lazy_property_names */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user