-
Notifications
You must be signed in to change notification settings - Fork 866
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
Fixed a bug with interpreter peeling introduced in #1510 #1578
Fixed a bug with interpreter peeling introduced in #1510 #1578
Conversation
0c0274c
to
c157518
Compare
+ "}\n" | ||
+ "testLambdaFunction().name"; | ||
Object value = cx.evaluateString(scope, source, "test", 1, null); | ||
assertEquals("Andrea", value); |
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, its about the interpreter, but i think we should run as many tests as possible with all optimization levels.
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.
Agreed, not much of a risk to use one of the methods to "runWithAllOptimizationLevels".
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.
There are also some assert... methods in the Utils class, maybe you can also use one of these to make this simpler
eg. assertWithAllOptimizationLevels
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.
Thanks
Thanks for catching this -- I ran in to the very same issue when trying to "lambdaize" some other classes. Could you please address the comments on running the test at many levels, in case this "white box test" ends up being important in the future? |
I've changed the code to use
|
Actually I ended up modifying the pre-existing |
Great solution. Thanks! |
I found a bug with the interpreter peeling introduced in #1510.
The code has an
if (fun instanceof LambdaFunction)
that does not work forLambdaConstructor
. These are a subclass ofLambdaFunction
, so theinstanceof
check passes, but they do not have thetarget
from the base class filled, so we get an error.Added also an unit test.