-
Notifications
You must be signed in to change notification settings - Fork 677
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
Implement Function.prototype.bind function #321
Implement Function.prototype.bind function #321
Conversation
Good to me |
} | ||
|
||
/* 9. */ | ||
ecma_value_t *arg_list = static_cast <ecma_value_t *> (mem_heap_alloc_block (arg_list_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use ecma-collection instead of heap array in the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_p
79ae006
to
8675e23
Compare
I've updated it according the reviews. |
@bzsolt please rebase to master |
9ff9a76
to
7b9b0e8
Compare
@egavrin rebased |
ecma_length_t arguments_list_len, /**< length of arguments list */ | ||
ecma_length_t *total_args_count) | ||
{ | ||
ecma_value_t *arg_list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_p
Ok to me, after fixing. |
ecma_function_bind_merge_arg_lists (ecma_object_t *func_obj_p, /**< Function object */ | ||
const ecma_value_t *arguments_list_p, /**< arguments list */ | ||
ecma_length_t arguments_list_len, /**< length of arguments list */ | ||
ecma_length_t *total_args_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comment on total_args_count
7b9b0e8
to
9a4fc5d
Compare
The PR is updated. |
ecma_object_t *target_func_obj_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, | ||
target_function_prop_p->u.internal_property.value); | ||
|
||
ecma_value_t bound_this_value = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Empty" value would not be correct in the case. Could you, please, initialize this using ecma_make_simple_value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, I've fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, in what cases the bound_this_prop_p
could be NULL
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked this, it looks the bound_this_prop_p
never could be NULL
.
Seems it remained from a previous version. Thanks for the notice.
After fixing #321 (diff), looks good to me. |
9a4fc5d
to
88db095
Compare
{ | ||
ecma_free_values_collection (ECMA_GET_NON_NULL_POINTER (ecma_collection_header_t, | ||
property_value), | ||
false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzsolt ah, my bad. Missed. ()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, it looks weird. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzsolt maybe we can do like that?
ecma_free_values_collection (ECMA_GET_NON_NULL_POINTER (ecma_collection_header_t, property_value),
false);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, it looks better, I've updated this.
Still good. |
83d3628
to
63a580e
Compare
+1 lgtm |
Looks good to me |
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
63a580e
to
1e90f83
Compare
make push |
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]