Open RevengerWizard opened 3 months ago
This is an interesting one.. Yeah I think if you'd asked me what I'd expect to happen I would say the Python one would be correct in that sx
hasn't been defined - this is the route I think we should probably go here too
Is there an existing issue for this?
Current Behavior
Given this function declaration with various optional arguments:
We can see that the optional argument
sy
changed unexpectedly:As far as I can tell it could have something to do to with the assignment to a local in the optional
sy=sx
. Calling with just1
as argument doesn't modify the other parameters, the problem seems to start with more arguments given.Expected Behavior
It should probably let us use safely locals.
The same example in Python directly throws an error telling us
name 'sx' is not defined
, but optional arguments in Python are already weird to deal with.On the other hand, Javascript gives us the expected values:
Steps To Reproduce
No response
Anything else?
The handling for optional arguments happens in the opcode
DEFINE_OPTIONAL
in the function declaration, not sure if it can help or if there might be a fix