Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Implement Array.prototype.splice(). #86

wants to merge 1 commit into from

Conversation

bzsolt
Copy link
Member

@bzsolt bzsolt commented May 21, 2015

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]

@ILyoan ILyoan mentioned this pull request May 21, 2015
25 tasks
@galpeter galpeter added this to the ECMA builtins milestone May 21, 2015
@dbatyai dbatyai added the ecma builtins Related to ECMA built-in routines label May 22, 2015
@dbatyai
Copy link
Member

dbatyai commented May 23, 2015

lgtm

@dbatyai dbatyai closed this May 23, 2015
@dbatyai dbatyai reopened this May 23, 2015
ecma_op_to_object (this_arg),
ret_value);

ecma_object_t* obj_p = ecma_get_object_from_value (obj_this);
Copy link
Contributor

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.

@bzsolt
Copy link
Member Author

bzsolt commented May 26, 2015

@galpeter fixed


/* 15. */
ecma_length_t idx = 0;
for (ecma_length_t arg_index = 2;
Copy link
Contributor

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?

Copy link
Member Author

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, okay.
lgtm

@egavrin
Copy link
Contributor

egavrin commented May 27, 2015

make push

@egavrin egavrin self-assigned this May 27, 2015

/* 11. */
ecma_length_t item_count;
if (args_number > 2)
Copy link
Contributor

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]
@galpeter
Copy link
Contributor

rebased & merged: dd94064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants