-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Hey there -
First, thanks so much for your work on Uglify / Uglify2 - such a wonderful tool. I ran into an error which I was able to trace back to a specific line in a jQuery plugin we use over here:
https://github.com/mathiasbynens/jquery-visibility/blob/master/jquery-visibility.js#L7
Specifically this part :
eventName = 'onfocusin' in document && 'hasFocus' in document ? 'focusin focusout' : 'focus blur',
It seems Uglify & Uglify2 doesn't like "in" operators within a ternary statement?
You can repro it pretty easily using your online demo tool thinger here:
http://lisperator.net/uglifyjs/#demo
Just copy and paste the jquery.visibility plugin src in, run uglify, and then copy & paste the output into chrome's js console.
Error is:
Uncaught SyntaxError: Unexpected token in
To fix it, I just re-wrote the line as an if statement.
Anyway, hope it helps!
-matt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels