You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wow! This is madness ... but I can confirm it on both Chrome and Firefox (Windows 10). It looks like a1 is somehow bound to the same spot in memory as argumens[0], but that's not how variables are supposed to work, right? Is this some obscure result of the browser's JS optimization?
Activity
[-]`flx_args` variable is overwritten while parsing[/-][+]`flx_args` is overwritten while parsing[/+]almarklein commentedon Oct 5, 2018
I am sorry, but I am having trouble understanding the problem. I don't see how
fle_args[0]is overwritten; it is only indexed, right?I tried to work with the example in your PR:
Which produces this, which seems fine:
Could you please try to adjust this code for it to cause the error on your end? That would hopefully make things more explicit :)
Winand commentedon Oct 5, 2018
Ok, I created a file
test.py:Then I compiled it to test.js with
script2js:When running this script in Chrome 70 I get the following error:

How is it possible?

I couldn't believe it but when we assign
a1 = stub1_args[0];we assign 3 toarguments[0]😞almarklein commentedon Oct 5, 2018
Wow! This is madness ... but I can confirm it on both Chrome and Firefox (Windows 10). It looks like
a1is somehow bound to the same spot in memory asargumens[0], but that's not how variables are supposed to work, right? Is this some obscure result of the browser's JS optimization?JS is full of surprises :(
almarklein commentedon Oct 5, 2018
https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/