-
Notifications
You must be signed in to change notification settings - Fork 858
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
Conversation
Any feedback / any hope to get this merged? |
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 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(); |
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 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.
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.
Ok, you are right. Was not really obvious to me also. Will update this later today.
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.
Have added some inline comments, hope this makes this a bit more clear.
Merged #322.
Thanks Greg, next pull request is on the way
RBRi
|
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.