Open kungfooman opened 3 years ago
I think I have also run accross this problem... very confusing as to why code that works correctly crashes the app. My code sample is here on line 65. Just add one sauce where indicated and run, it fails. https://enkimute.github.io/ganja.js/examples/coffeeshop.html#7luxYQzPN
BTW: GREAT APP!!!!!
Right, the integrated Ganjascript parser isn't the most reliable piece of software :sweat_smile: I run into more issues and IMO the best way forward would be to resort to using a maintained and extendable JS parser library (I have most experience with @babel/parser
, so I would probably go with that).
However Babel parser comes with around 0.5 MB extra download (unminified)...
Acorn is smaller at least:
https://www.npmjs.com/package/acorn/v/7.4.1?activeTab=code
And that's not minified yet aswell - adding minification and gzip - it's like the size of a small JPG.
I just run into an issue with code like this:
It looks nearly identical, but the amount of spaces (1 space vs 2 spaces) generates different behaviour: