Skip to content

Use [[DefineOwnProperty]] in Array builtins where necessary. #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dbatyai
Copy link
Member

@dbatyai dbatyai commented Jul 23, 2015

[[Put]] fails to create the property when we have inherited properties from Array.prototype.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com

@dbatyai dbatyai added bug Undesired behaviour ecma builtins Related to ECMA built-in routines labels Jul 23, 2015
@dbatyai dbatyai added this to the ECMA builtins milestone Jul 23, 2015
ecma_free_completion_value (put_comp_value);

/* 10.c.ii */
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should introduce a helper function to eliminate repetitive code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added helper.

@dbatyai dbatyai force-pushed the array_use_define_own_prop branch 2 times, most recently from a5e5fe8 to e2a4498 Compare July 28, 2015 10:26
@dbatyai dbatyai assigned egavrin and unassigned dbatyai Jul 28, 2015
@egavrin
Copy link
Contributor

egavrin commented Jul 28, 2015

good to me

@egavrin egavrin assigned galpeter and unassigned egavrin Jul 28, 2015
* Returned value must be freed with ecma_free_completion_value.
*/
ecma_completion_value_t
ecma_builtin_helper_def_prop (ecma_object_t *obj, /**< object */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be: obj_p

@dbatyai dbatyai force-pushed the array_use_define_own_prop branch from e2a4498 to fd09ada Compare July 29, 2015 10:29
@@ -35,6 +35,13 @@ extern ecma_completion_value_t ecma_builtin_helper_array_concat_value (ecma_obje
ecma_value_t);
extern uint32_t ecma_builtin_helper_array_index_normalize (ecma_number_t index, uint32_t length);
extern uint32_t ecma_builtin_helper_string_index_normalize (ecma_number_t index, uint32_t length);
extern ecma_completion_value_t ecma_builtin_helper_def_prop (ecma_object_t *obj,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be: obj_p

@dbatyai dbatyai force-pushed the array_use_define_own_prop branch from fd09ada to b154597 Compare July 29, 2015 13:19
@dbatyai
Copy link
Member Author

dbatyai commented Jul 29, 2015

@galpeter, fixed.

@galpeter
Copy link
Contributor

lgtm

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
@dbatyai dbatyai force-pushed the array_use_define_own_prop branch from b154597 to 1193de8 Compare July 30, 2015 07:32
@dbatyai dbatyai merged commit 1193de8 into jerryscript-project:master Jul 30, 2015
@dbatyai dbatyai deleted the array_use_define_own_prop branch July 31, 2015 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants