Esprima minification problems #5227
Unanswered
espruino-discuss3
asked this question in
General
Replies: 1 comment
-
Posted at 2016-03-16 by @gfwilliams Interesting - thanks! So for modules it wouldn't be an issue as that happens already, but it's presumably the whole project that causes problems. I reckon this could be fixed pretty easily in |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-03-16 by DrAzzy
Esprima minification (used in the IDE by default) has a really nasty behavior....
It removes just about all the linebreaks. So Espruino has to hold the entire blob of code being sent over, and then execute it. I ran into this with Espruino on ESP8266 - as far as I could tell, it was being sent over as one giant blob of commands, with no linebreaks, so Espruino wouldn't process the pieces until it finally got a linebreak (assuming it didn't run out of memory first).
That's my analysis of it at least. If only there was some way to tell it to put some linebreaks in, like at the end of functions...
Here's the code that manifests it:
https://github.com/SpenceKonde/AzzyProjects/blob/d739f857b3aedf089acf26d08a4c5a24fc9d01a4/Animate/Version5.js
With Esprima(offline) minification for modules and code, it fails with out of memory errors (often "cannot create string").
If I change the code minification to closure, it works fine.
Beta Was this translation helpful? Give feedback.
All reactions