lys-lang / node-ebnf

Create AST PEG Parsers from formal grammars in JavaScript
https://menduz.com/ebnf-highlighter/
MIT License
104 stars 9 forks source link

fix: 🐛 Rely on implicit global instead of explicit #15

Closed GerkinDev closed 4 years ago

GerkinDev commented 4 years ago

Replace global.eval with eval in order to work in the browser. Errors of kind ReferenceError are logged to the console, to show errors about missing eval. This fix was required for me because I had silent errors about missing global I struggled on during hours when using this lib in a browser application.

menduz commented 4 years ago

Thank you so much. I noticed a 100x slowdown in the browser before, since these errors were silent, does this PR also help with that?

menduz commented 4 years ago

ebnf@1.7.0

GerkinDev commented 4 years ago

I don't know for the slowdown. It simply did not worked at all before the fix, so I can't really compare before/after

A'd thank you so much for the quick release!