-
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 Array.prototype.splice(). #86
Conversation
lgtm |
ecma_op_to_object (this_arg), | ||
ret_value); | ||
|
||
ecma_object_t* obj_p = ecma_get_object_from_value (obj_this); |
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.
AFAIK: the *
should be at the variable.
@galpeter fixed |
|
||
/* 15. */ | ||
ecma_length_t idx = 0; | ||
for (ecma_length_t arg_index = 2; |
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.
Why is the arg_index 2?
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.
Because the first two argument are the start_index and the delete_count usually.
If the args_number is less than or equal to 2, then the condition of the loop will be false (we shouldn't put items into the array).
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 see, okay.
lgtm
|
|
||
/* 11. */ | ||
ecma_length_t item_count; | ||
if (args_number > 2) |
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.
Add blank line before if
, please.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
rebased & merged: dd94064 |
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]