Skip to content
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

JS multiline comment is interpreted as unclosed regex #138

Open
adrianstas opened this issue Apr 20, 2018 · 1 comment
Open

JS multiline comment is interpreted as unclosed regex #138

adrianstas opened this issue Apr 20, 2018 · 1 comment

Comments

@adrianstas
Copy link

adrianstas commented Apr 20, 2018

Hi

While trying minify the following file:
https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js

The following exception is occuring:
'System.Exception: Error: JSMIN Unterminated set in Regular Expression literal'

Probably you don't escape multiline comments properly.

Here's the wrong interpretation:
image

Adrian

@Shazwazza
Copy link
Owner

the minifier isn't smart, it's just fast. It doesn't produce an AST for minification so there are some edge cases where odd things will break it.
I won't have much time to look into this very soon, your best bet is to remove this syntax.
The minifier relies on an updated version of JsMin which i've been fixing over the years to support these odd edge cases, you can find it here: https://github.com/shazwazza/jsminsharp but it's a nightmare to debug (you should see the original!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants