Replace // double slash comments with /* */. (#1461)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
committed by
Tilmann Scheller
parent
4d2c22a118
commit
fb3e8cf8b8
@@ -53,7 +53,7 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
{
|
||||
if (ecma_is_value_number (y))
|
||||
{
|
||||
// 1.c
|
||||
/* 1.c */
|
||||
ecma_number_t x_num = ecma_get_number_from_value (x);
|
||||
ecma_number_t y_num = ecma_get_number_from_value (y);
|
||||
|
||||
@@ -94,7 +94,7 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
{
|
||||
if (ecma_is_value_string (y))
|
||||
{
|
||||
// 1., d.
|
||||
/* 1., d. */
|
||||
ecma_string_t *x_str_p = ecma_get_string_from_value (x);
|
||||
ecma_string_t *y_str_p = ecma_get_string_from_value (y);
|
||||
|
||||
@@ -105,7 +105,7 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
|
||||
if (ecma_is_value_number (y))
|
||||
{
|
||||
// 4.
|
||||
/* 4. */
|
||||
ecma_value_t x_num_value = ecma_op_to_number (x);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (x_num_value))
|
||||
@@ -129,12 +129,12 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
{
|
||||
if (ecma_is_value_boolean (x))
|
||||
{
|
||||
// 1., e.
|
||||
/* 1., e. */
|
||||
/* Note: the (x == y) comparison captures the true case. */
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
// 7.
|
||||
/* 7. */
|
||||
return ecma_op_abstract_equality_compare (x, ecma_make_integer_value (ecma_is_value_true (y) ? 1 : 0));
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
if (ecma_is_value_string (y)
|
||||
|| ecma_is_value_number (y))
|
||||
{
|
||||
// 9.
|
||||
/* 9. */
|
||||
ecma_value_t x_prim_value = ecma_op_to_primitive (x, ECMA_PREFERRED_TYPE_NO);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (x_prim_value))
|
||||
@@ -157,22 +157,22 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
return compare_result;
|
||||
}
|
||||
|
||||
// 1., f.
|
||||
/* 1., f. */
|
||||
/* Note: the (x == y) comparison captures the true case. */
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
if (ecma_is_value_boolean (x))
|
||||
{
|
||||
// 6.
|
||||
/* 6. */
|
||||
return ecma_op_abstract_equality_compare (ecma_make_integer_value (ecma_is_value_true (x) ? 1 : 0), y);
|
||||
}
|
||||
|
||||
if (ecma_is_value_undefined (x)
|
||||
|| ecma_is_value_null (x))
|
||||
{
|
||||
// 1. a., b.
|
||||
// 2., 3.
|
||||
/* 1. a., b. */
|
||||
/* 2., 3. */
|
||||
bool is_equal = ecma_is_value_undefined (y) || ecma_is_value_null (y);
|
||||
|
||||
return ecma_make_boolean_value (is_equal);
|
||||
@@ -285,7 +285,7 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
{
|
||||
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
|
||||
// 1., 2.
|
||||
/* 1., 2. */
|
||||
ECMA_TRY_CATCH (prim_first_converted_value,
|
||||
ecma_op_to_primitive (x, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
@@ -301,17 +301,17 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
|
||||
if (!(is_px_string && is_py_string))
|
||||
{
|
||||
// 3.
|
||||
/* 3. */
|
||||
|
||||
// a.
|
||||
/* a. */
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (nx, px, ret_value);
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (ny, py, ret_value);
|
||||
|
||||
// b.
|
||||
/* b. */
|
||||
if (ecma_number_is_nan (nx)
|
||||
|| ecma_number_is_nan (ny))
|
||||
{
|
||||
// c., d.
|
||||
/* c., d. */
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
}
|
||||
else
|
||||
@@ -325,36 +325,36 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
|| (ecma_number_is_zero (nx)
|
||||
&& ecma_number_is_zero (ny)))
|
||||
{
|
||||
// e., f., g.
|
||||
/* e., f., g. */
|
||||
is_x_less_than_y_check = false;
|
||||
}
|
||||
else if (ecma_number_is_infinity (nx)
|
||||
&& !ecma_number_is_negative (nx))
|
||||
{
|
||||
// h.
|
||||
/* h. */
|
||||
is_x_less_than_y_check = false;
|
||||
}
|
||||
else if (ecma_number_is_infinity (ny)
|
||||
&& !ecma_number_is_negative (ny))
|
||||
{
|
||||
// i.
|
||||
/* i. */
|
||||
is_x_less_than_y_check = true;
|
||||
}
|
||||
else if (ecma_number_is_infinity (ny)
|
||||
&& ecma_number_is_negative (ny))
|
||||
{
|
||||
// j.
|
||||
/* j. */
|
||||
is_x_less_than_y_check = false;
|
||||
}
|
||||
else if (ecma_number_is_infinity (nx)
|
||||
&& ecma_number_is_negative (nx))
|
||||
{
|
||||
// k.
|
||||
/* k. */
|
||||
is_x_less_than_y_check = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// l.
|
||||
/* l. */
|
||||
JERRY_ASSERT (!ecma_number_is_nan (nx)
|
||||
&& !ecma_number_is_infinity (nx));
|
||||
JERRY_ASSERT (!ecma_number_is_nan (ny)
|
||||
@@ -382,7 +382,7 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (nx);
|
||||
}
|
||||
else
|
||||
{ // 4.
|
||||
{ /* 4. */
|
||||
JERRY_ASSERT (is_px_string && is_py_string);
|
||||
|
||||
ecma_string_t *str_x_p = ecma_get_string_from_value (px);
|
||||
|
||||
@@ -121,7 +121,7 @@ ecma_op_same_value (ecma_value_t x, /**< ecma value */
|
||||
* If both are NaN
|
||||
* return true;
|
||||
* else
|
||||
* // one of the numbers is NaN, and another - is not
|
||||
* one of the numbers is NaN, and another - is not
|
||||
* return false;
|
||||
*/
|
||||
return (is_x_nan && is_y_nan);
|
||||
@@ -435,7 +435,7 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */
|
||||
ecma_object_t *
|
||||
ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p) /**< property descriptor */
|
||||
{
|
||||
// 2.
|
||||
/* 2. */
|
||||
ecma_object_t *obj_p = ecma_op_create_object_object_noarg ();
|
||||
|
||||
ecma_value_t completion;
|
||||
@@ -453,13 +453,13 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
prop_desc.is_configurable = true;
|
||||
}
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
if (src_prop_desc_p->is_value_defined
|
||||
|| src_prop_desc_p->is_writable_defined)
|
||||
{
|
||||
JERRY_ASSERT (prop_desc.is_value_defined && prop_desc.is_writable_defined);
|
||||
|
||||
// a.
|
||||
/* a. */
|
||||
prop_desc.value = src_prop_desc_p->value;
|
||||
|
||||
ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
|
||||
@@ -470,7 +470,7 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
ecma_deref_ecma_string (value_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
// b.
|
||||
/* b. */
|
||||
const bool is_writable = (src_prop_desc_p->is_writable);
|
||||
prop_desc.value = ecma_make_boolean_value (is_writable);
|
||||
|
||||
@@ -484,11 +484,11 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4.
|
||||
/* 4. */
|
||||
JERRY_ASSERT (src_prop_desc_p->is_get_defined
|
||||
|| src_prop_desc_p->is_set_defined);
|
||||
|
||||
// a.
|
||||
/* a. */
|
||||
if (src_prop_desc_p->get_p == NULL)
|
||||
{
|
||||
prop_desc.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
@@ -506,7 +506,7 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
|
||||
ecma_deref_ecma_string (get_magic_string_p);
|
||||
JERRY_ASSERT (ecma_is_value_true (completion));
|
||||
|
||||
// b.
|
||||
/* b. */
|
||||
if (src_prop_desc_p->set_p == NULL)
|
||||
{
|
||||
prop_desc.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
@@ -567,7 +567,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
|
||||
// 1.
|
||||
/* 1. */
|
||||
if (!ecma_is_value_object (obj_value))
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object."));
|
||||
@@ -576,10 +576,10 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
|
||||
|
||||
// 2.
|
||||
/* 2. */
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
ecma_string_t *enumerable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE);
|
||||
|
||||
ECMA_TRY_CATCH (enumerable_prop_value,
|
||||
@@ -600,7 +600,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 4.
|
||||
/* 4. */
|
||||
ecma_string_t *configurable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE);
|
||||
|
||||
ECMA_TRY_CATCH (configurable_prop_value,
|
||||
@@ -622,7 +622,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 5.
|
||||
/* 5. */
|
||||
ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
|
||||
|
||||
ECMA_TRY_CATCH (value_prop_value,
|
||||
@@ -644,7 +644,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 6.
|
||||
/* 6. */
|
||||
ecma_string_t *writable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE);
|
||||
|
||||
ECMA_TRY_CATCH (writable_prop_value,
|
||||
@@ -666,7 +666,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 7.
|
||||
/* 7. */
|
||||
ecma_string_t *get_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GET);
|
||||
|
||||
ECMA_TRY_CATCH (get_prop_value,
|
||||
@@ -709,8 +709,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 8.
|
||||
|
||||
/* 8. */
|
||||
ecma_string_t *set_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SET);
|
||||
|
||||
ECMA_TRY_CATCH (set_prop_value,
|
||||
@@ -753,7 +752,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_empty (ret_value));
|
||||
|
||||
// 9.
|
||||
/* 9. */
|
||||
if (prop_desc.is_get_defined
|
||||
|| prop_desc.is_set_defined)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
is_strict_mode_code = true;
|
||||
}
|
||||
|
||||
// 1., 4., 13.
|
||||
/* 1., 4., 13. */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
|
||||
|
||||
ecma_object_t *func_p = ecma_create_object (prototype_obj_p,
|
||||
@@ -121,14 +121,14 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
|
||||
ecma_deref_object (prototype_obj_p);
|
||||
|
||||
// 2., 6., 7., 8.
|
||||
/* 2., 6., 7., 8. */
|
||||
/*
|
||||
* We don't setup [[Get]], [[Call]], [[Construct]], [[HasInstance]] for each function object.
|
||||
* Instead we set the object's type to ECMA_OBJECT_TYPE_FUNCTION
|
||||
* that defines which version of the routine should be used on demand.
|
||||
*/
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
/*
|
||||
* [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type.
|
||||
*
|
||||
@@ -137,21 +137,21 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) func_p;
|
||||
|
||||
// 9.
|
||||
/* 9. */
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.scope_cp, scope_p);
|
||||
|
||||
// 10., 11., 12.
|
||||
/* 10., 11., 12. */
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.bytecode_cp, bytecode_data_p);
|
||||
ecma_bytecode_ref ((ecma_compiled_code_t *) bytecode_data_p);
|
||||
|
||||
// 14., 15., 16., 17., 18.
|
||||
/* 14., 15., 16., 17., 18. */
|
||||
/*
|
||||
* 'length' and 'prototype' properties are instantiated lazily
|
||||
*
|
||||
* See also: ecma_op_function_try_lazy_instantiate_property
|
||||
*/
|
||||
|
||||
// 19.
|
||||
/* 19. */
|
||||
if (is_strict_mode_code)
|
||||
{
|
||||
ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
|
||||
@@ -481,7 +481,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ecma_object_t *scope_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
|
||||
ext_func_p->u.function.scope_cp);
|
||||
|
||||
// 8.
|
||||
/* 8. */
|
||||
ecma_value_t this_binding;
|
||||
bool is_strict;
|
||||
bool is_no_lex_env;
|
||||
@@ -493,7 +493,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
is_strict = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) ? true : false;
|
||||
is_no_lex_env = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED) ? true : false;
|
||||
|
||||
// 1.
|
||||
/* 1. */
|
||||
if (is_strict)
|
||||
{
|
||||
this_binding = ecma_copy_value (this_arg_value);
|
||||
@@ -501,18 +501,18 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
else if (ecma_is_value_undefined (this_arg_value)
|
||||
|| ecma_is_value_null (this_arg_value))
|
||||
{
|
||||
// 2.
|
||||
/* 2. */
|
||||
this_binding = ecma_make_object_value (ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3., 4.
|
||||
/* 3., 4. */
|
||||
this_binding = ecma_op_to_object (this_arg_value);
|
||||
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (this_binding));
|
||||
}
|
||||
|
||||
// 5.
|
||||
/* 5. */
|
||||
ecma_object_t *local_env_p;
|
||||
if (is_no_lex_env)
|
||||
{
|
||||
@@ -629,24 +629,24 @@ ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< F
|
||||
|
||||
ecma_string_t *prototype_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
|
||||
|
||||
// 5.
|
||||
/* 5. */
|
||||
ECMA_TRY_CATCH (func_obj_prototype_prop_value,
|
||||
ecma_op_object_get (func_obj_p,
|
||||
prototype_magic_string_p),
|
||||
ret_value);
|
||||
|
||||
// 1., 2., 4.
|
||||
/* 1., 2., 4. */
|
||||
ecma_object_t *obj_p;
|
||||
if (ecma_is_value_object (func_obj_prototype_prop_value))
|
||||
{
|
||||
// 6.
|
||||
/* 6. */
|
||||
obj_p = ecma_create_object (ecma_get_object_from_value (func_obj_prototype_prop_value),
|
||||
0,
|
||||
ECMA_OBJECT_TYPE_GENERAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 7.
|
||||
/* 7. */
|
||||
ecma_object_t *prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
|
||||
obj_p = ecma_create_object (prototype_p, 0, ECMA_OBJECT_TYPE_GENERAL);
|
||||
@@ -654,7 +654,7 @@ ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< F
|
||||
ecma_deref_object (prototype_p);
|
||||
}
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
/*
|
||||
* [[Class]] property of ECMA_OBJECT_TYPE_GENERAL type objects
|
||||
* without ECMA_INTERNAL_PROPERTY_CLASS internal property
|
||||
@@ -663,7 +663,7 @@ ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< F
|
||||
* See also: ecma_object_get_class_name.
|
||||
*/
|
||||
|
||||
// 8.
|
||||
/* 8. */
|
||||
ECMA_TRY_CATCH (call_completion,
|
||||
ecma_op_function_call (func_obj_p,
|
||||
ecma_make_object_value (obj_p),
|
||||
@@ -671,14 +671,14 @@ ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< F
|
||||
arguments_list_len),
|
||||
ret_value);
|
||||
|
||||
// 9.
|
||||
/* 9. */
|
||||
if (ecma_is_value_object (call_completion))
|
||||
{
|
||||
ret_value = ecma_copy_value (call_completion);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 10.
|
||||
/* 10. */
|
||||
ecma_ref_object (obj_p);
|
||||
ret_value = ecma_make_object_value (obj_p);
|
||||
}
|
||||
|
||||
@@ -50,17 +50,17 @@ ecma_op_get_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< referenc
|
||||
{
|
||||
const bool is_unresolvable_reference = (ref_base_lex_env_p == NULL);
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
if (unlikely (is_unresolvable_reference))
|
||||
{
|
||||
return ecma_raise_reference_error (ECMA_ERR_MSG ("Cannot resolve reference."));
|
||||
}
|
||||
|
||||
// 5.
|
||||
/* 5. */
|
||||
JERRY_ASSERT (ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
|
||||
// 5.a
|
||||
/* 5.a */
|
||||
return ecma_op_get_binding_value (ref_base_lex_env_p,
|
||||
var_name_string_p,
|
||||
is_strict);
|
||||
@@ -144,17 +144,17 @@ ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< referenc
|
||||
{
|
||||
const bool is_unresolvable_reference = (ref_base_lex_env_p == NULL);
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
if (unlikely (is_unresolvable_reference))
|
||||
{
|
||||
// 3.a.
|
||||
/* 3.a. */
|
||||
if (is_strict)
|
||||
{
|
||||
return ecma_raise_reference_error (ECMA_ERR_MSG ("Cannot resolve reference."));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3.b.
|
||||
/* 3.b. */
|
||||
ecma_object_t *global_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL);
|
||||
|
||||
ecma_value_t completion = ecma_op_object_put (global_object_p,
|
||||
@@ -170,11 +170,11 @@ ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< referenc
|
||||
}
|
||||
}
|
||||
|
||||
// 5.
|
||||
/* 5. */
|
||||
JERRY_ASSERT (ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
|
||||
// 5.a
|
||||
/* 5.a */
|
||||
return ecma_op_set_mutable_binding (ref_base_lex_env_p,
|
||||
var_name_string_p,
|
||||
value,
|
||||
|
||||
@@ -114,7 +114,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
|
||||
ecma_property_value_t *prop_value_p;
|
||||
|
||||
// 11.a, 11.b
|
||||
/* 11.a, 11.b */
|
||||
for (ecma_length_t indx = 0;
|
||||
indx < arguments_number;
|
||||
indx++)
|
||||
@@ -131,7 +131,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
ecma_deref_ecma_string (indx_string_p);
|
||||
}
|
||||
|
||||
// 7.
|
||||
/* 7. */
|
||||
ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
|
||||
|
||||
prop_value_p = ecma_create_named_data_property (obj_p,
|
||||
@@ -145,7 +145,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
|
||||
// 13.
|
||||
/* 13. */
|
||||
if (!is_strict)
|
||||
{
|
||||
ecma_string_t *callee_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE);
|
||||
@@ -163,7 +163,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
|
||||
{
|
||||
ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
|
||||
|
||||
// 14.
|
||||
/* 14. */
|
||||
prop_desc = ecma_make_empty_property_descriptor ();
|
||||
{
|
||||
prop_desc.is_get_defined = true;
|
||||
@@ -244,7 +244,7 @@ ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, /**< the
|
||||
* descriptor */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
// 3.
|
||||
/* 3. */
|
||||
ecma_value_t ret_value = ecma_op_general_object_define_own_property (object_p,
|
||||
property_name_p,
|
||||
property_desc_p,
|
||||
@@ -326,7 +326,7 @@ ecma_op_arguments_object_delete (ecma_object_t *object_p, /**< the object */
|
||||
ecma_string_t *property_name_p, /**< property name */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
// 3.
|
||||
/* 3. */
|
||||
ecma_value_t ret_value = ecma_op_general_object_delete (object_p, property_name_p, is_throw);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (ret_value))
|
||||
|
||||
@@ -62,7 +62,7 @@ ecma_op_create_object_object_noarg (void)
|
||||
{
|
||||
ecma_object_t *object_prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
|
||||
// 3., 4., 6., 7.
|
||||
/* 3., 4., 6., 7. */
|
||||
ecma_object_t *obj_p = ecma_op_create_object_object_noarg_and_set_prototype (object_prototype_p);
|
||||
|
||||
ecma_deref_object (object_prototype_p);
|
||||
@@ -87,12 +87,12 @@ ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of construct
|
||||
|| ecma_is_value_string (value)
|
||||
|| ecma_is_value_boolean (value))
|
||||
{
|
||||
// 1.b, 1.c, 1.d
|
||||
/* 1.b, 1.c, 1.d */
|
||||
return ecma_op_to_object (value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2.
|
||||
/* 2. */
|
||||
JERRY_ASSERT (ecma_is_value_undefined (value)
|
||||
|| ecma_is_value_null (value));
|
||||
|
||||
@@ -147,7 +147,7 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
/* 1. */
|
||||
ecma_property_ref_t property_ref;
|
||||
|
||||
ecma_property_t property = ecma_op_object_get_own_property (obj_p,
|
||||
@@ -155,29 +155,29 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
&property_ref,
|
||||
ECMA_PROPERTY_GET_NO_OPTIONS);
|
||||
|
||||
// 2.
|
||||
/* 2. */
|
||||
if (property == ECMA_PROPERTY_TYPE_NOT_FOUND)
|
||||
{
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
|
||||
// 3.
|
||||
/* 3. */
|
||||
if (ecma_is_property_configurable (property))
|
||||
{
|
||||
// a.
|
||||
/* a. */
|
||||
ecma_delete_property (obj_p, property_ref.value_p);
|
||||
|
||||
// b.
|
||||
/* b. */
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
else if (is_throw)
|
||||
{
|
||||
// 4.
|
||||
/* 4. */
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a configurable property."));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 5.
|
||||
/* 5. */
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
JERRY_ASSERT (property_desc_p->is_enumerable_defined || !property_desc_p->is_enumerable);
|
||||
JERRY_ASSERT (property_desc_p->is_writable_defined || !property_desc_p->is_writable);
|
||||
|
||||
// 1.
|
||||
/* 1. */
|
||||
ecma_extended_property_ref_t ext_property_ref;
|
||||
ecma_property_t current_prop;
|
||||
|
||||
@@ -324,18 +324,18 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
|
||||
if (current_prop == ECMA_PROPERTY_TYPE_NOT_FOUND)
|
||||
{
|
||||
// 3.
|
||||
/* 3. */
|
||||
if (!ecma_get_object_extensible (object_p))
|
||||
{
|
||||
// 2.
|
||||
/* 2. */
|
||||
return ecma_reject (is_throw);
|
||||
}
|
||||
|
||||
// 4.
|
||||
/* 4. */
|
||||
|
||||
if (property_desc_type != ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
|
||||
{
|
||||
// a.
|
||||
/* a. */
|
||||
|
||||
JERRY_ASSERT (property_desc_type == ECMA_PROPERTY_TYPE_GENERIC
|
||||
|| property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA);
|
||||
@@ -367,7 +367,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
}
|
||||
else
|
||||
{
|
||||
// b.
|
||||
/* b. */
|
||||
|
||||
uint8_t prop_attributes = 0;
|
||||
|
||||
@@ -390,7 +390,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
|
||||
// 6.
|
||||
/* 6. */
|
||||
ecma_property_types_t current_property_type = ECMA_PROPERTY_GET_TYPE (current_prop);
|
||||
const bool is_current_configurable = ecma_is_property_configurable (current_prop);
|
||||
|
||||
@@ -398,7 +398,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
|| current_property_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR
|
||||
|| current_property_type == ECMA_PROPERTY_TYPE_VIRTUAL);
|
||||
|
||||
// 7. a., b.
|
||||
/* 7. a., b. */
|
||||
if (!is_current_configurable
|
||||
&& (property_desc_p->is_configurable
|
||||
|| (property_desc_p->is_enumerable_defined
|
||||
@@ -430,7 +430,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
return result;
|
||||
}
|
||||
|
||||
// 8.
|
||||
/* 8. */
|
||||
if (property_desc_type == ECMA_PROPERTY_TYPE_GENERIC)
|
||||
{
|
||||
/* No action required. */
|
||||
@@ -442,7 +442,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
{
|
||||
if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA)
|
||||
{
|
||||
// 10. a. i. & ii.
|
||||
/* 10. a. i. & ii. */
|
||||
if (!ecma_is_property_writable (current_prop)
|
||||
&& (property_desc_p->is_writable
|
||||
|| (property_desc_p->is_value_defined
|
||||
@@ -454,9 +454,9 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
}
|
||||
else
|
||||
{
|
||||
// 11.
|
||||
/* 11. */
|
||||
|
||||
// a.
|
||||
/* a. */
|
||||
ecma_property_value_t *value_p = ext_property_ref.property_ref.value_p;
|
||||
|
||||
if ((property_desc_p->is_get_defined
|
||||
@@ -464,7 +464,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
|| (property_desc_p->is_set_defined
|
||||
&& property_desc_p->set_p != ecma_get_named_accessor_property_setter (value_p)))
|
||||
{
|
||||
// i., ii.
|
||||
/* i., ii. */
|
||||
return ecma_reject (is_throw);
|
||||
}
|
||||
}
|
||||
@@ -472,10 +472,10 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
}
|
||||
else
|
||||
{
|
||||
// 9.
|
||||
/* 9. */
|
||||
if (!is_current_configurable)
|
||||
{
|
||||
// a.
|
||||
/* a. */
|
||||
return ecma_reject (is_throw);
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
*(ext_property_ref.property_p) = prop_flags;
|
||||
}
|
||||
|
||||
// 12.
|
||||
/* 12. */
|
||||
if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA)
|
||||
{
|
||||
JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*ext_property_ref.property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
|
||||
|
||||
Reference in New Issue
Block a user