-
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
Implemented Array.prototype.lastIndexOf(). #77
Implemented Array.prototype.lastIndexOf(). #77
Conversation
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
k = (uint32_t) n; | ||
} | ||
} | ||
/* 7. */ |
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.
Shouldn't we use ecma_number_abs
here?
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.
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.
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.
Anyway, I'd prefer not to produce duplicates of code.
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.
Sorry, could you please explain what part do you consider as duplicate?
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.
ecma_number_abs
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 don't think the function call would simplify the algorithm but it could have performance and code size impact.
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.
@kkristof agree, let's leave the current version.
I checked the implementation and it is looking good to me. |
@dbatyai could you merge it to master, please? |
merged: 36b8fa5 |
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]