-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error happens when decomment parses some regular expressions #15
Comments
When Esprima doesn’t like your code, it must an invalid JavaScript ;) |
The compressed source code is like if(true){}/\d/.test(''); Then gulp-strip-comments parses my code with Should I make an issue to gulp-strip-comments? |
I’m not sure, I will test it later though ;) |
Here's the test I've done, and it all looks fine: const decomment = require('decomment');
const str = 'if(true){}/\d/.test(\'\');';
const s = decomment(str);
console.log(s);
//=> if(true){}/d/.test(''); Have you tried gulp-decomment? |
Sorry for my late reply. The error happends in |
You should log/chase it against the Esprima engine as the one that fails to process that piece of JavaScript. There is nothing that can be done about it within this library. |
There, I've opened an issue: Fails on a compressed piece of code. |
Thanks! |
The author of Esprima claims he fixed it, but I've just released an update, and I can still reproduce the issue :( |
Esprima hasn't been published for 3 years, and now looks a bit abandoned. I presently do not have time for rewriting this library to use a different parser. |
A minimal demo:
Error log:
The text was updated successfully, but these errors were encountered: