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

fix static array functions and add test cases #322

Merged
merged 3 commits into from
Sep 22, 2017
Merged

fix static array functions and add test cases #322

merged 3 commits into from
Sep 22, 2017

Conversation

rbri
Copy link
Collaborator

@rbri rbri commented Sep 2, 2017

Looks like the last refactoring of the array functions had introduces a bug. Hope you like the fix and i did the test stuff right.

@rbri
Copy link
Collaborator Author

rbri commented Sep 20, 2017

Any feedback / any hope to get this merged?

Copy link
Collaborator

@gbrail gbrail left a comment

Choose a reason for hiding this comment

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

I just want to document what's going on here since it's not obvious to someone new to the code (obviously because we let the bug get in in the first place).

Thanks for adding all the new tests!

@@ -1570,7 +1570,7 @@ else if (start < 0)
private static Object iterativeMethod(Context cx, IdFunctionObject idFunctionObject, Scriptable scope,
Scriptable thisObj, Object[] args)
{
int id = idFunctionObject.methodId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I get what you're fixing here.

This case is already convoluted enough and the use of "Math.abs" is not going to be obvious to someone else using the code.

Can you add a comment to the effect that this works because at the very bottom of the file, we use negative numbers to represent the non-prototype versions of these functions and we want them all to work? Otherwise this looks good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, you are right. Was not really obvious to me also. Will update this later today.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have added some inline comments, hope this makes this a bit more clear.

@gbrail gbrail merged commit db61b9a into mozilla:master Sep 22, 2017
@rbri
Copy link
Collaborator Author

rbri commented Sep 22, 2017 via email

@rbri rbri deleted the array_statics branch March 16, 2019 11:51
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.

2 participants