Esprima Mangle bug? #4748
Unanswered
espruino-discuss2
asked this question in
Bangle.js
Replies: 1 comment
-
Posted at 2022-05-25 by rigrig It was a missing feature/bug in Espruino ( Posted at 2022-05-26 by @gfwilliams
Actually this post reminded me that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Posted at 2022-05-25 by yngv126399
I've narrowed down a bug to when I use Esprima's Mangle to shorten variable names (other minification options don't generate the error).
I'm seeing an error in the Bangle emulator when I execute this:
I'm getting this error:
You can see that it changed the loop variable to 'g' , which should still be a local variable, but it clearly affects Bangle's 'g'.
However, if you do any one of the following, the error goes away and the Bangle 'g' is fine:
Just thought I'd share; not sure whether this is an Esprima bug, or an interpreter bug (a "let g=" within a for loop should be its own scope and not interfere with global context?)
Beta Was this translation helpful? Give feedback.
All reactions