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

Implemented Array.prototype.lastIndexOf(). #77

Closed
wants to merge 1 commit into from
Closed

Implemented Array.prototype.lastIndexOf(). #77

wants to merge 1 commit into from

Conversation

dbatyai
Copy link
Member

@dbatyai dbatyai commented May 18, 2015

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
k = (uint32_t) n;
}
}
/* 7. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use ecma_number_abs here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sincen is negative here, it doesn't really makes a difference. I'd say it's simpler to do it this way, because ecma_number_abs requires an ecma_number_t as its param.

Copy link
Contributor

Choose a reason for hiding this comment

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

Anyway, I'd prefer not to produce duplicates of 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.

Sorry, could you please explain what part do you consider as duplicate?

Copy link
Contributor

Choose a reason for hiding this comment

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

ecma_number_abs

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the function call would simplify the algorithm but it could have performance and code size impact.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kkristof agree, let's leave the current version.

@ILyoan ILyoan mentioned this pull request May 19, 2015
25 tasks
@kkristof
Copy link
Contributor

I checked the implementation and it is looking good to me.

@galpeter galpeter added this to the ECMA builtins milestone May 20, 2015
@egavrin
Copy link
Contributor

egavrin commented May 21, 2015

@dbatyai could you merge it to master, please?

@dbatyai
Copy link
Member Author

dbatyai commented May 21, 2015

merged: 36b8fa5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants