RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

Cannot compress with YUI Compressor or Google Closure Compiler #1860

Closed cataclysmuprising closed 6 years ago

cataclysmuprising commented 6 years ago

Syntax validation failed with these compressors. The error show

Apr 09, 2018 11:29:18 AM com.google.javascript.jscomp.parsing.ParserRunner parse
INFO: Error parsing D:\temp\jquery.inputmask.bundle.js: Compilation produced 3 syntax errors. (D:\temp\jquery.inputmask.bundle.js#1)
Apr 09, 2018 11:29:18 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: D:\temp\jquery.inputmask.bundle.js:1002: ERROR - Parse error. identifier is a reserved word
                static || null !== test.fn && void 0 !== testPos.input ? static && null !== test.fn && void 0 !== testPos.input && (static = !1, 
                ^

Apr 09, 2018 11:29:18 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: D:\temp\jquery.inputmask.bundle.js:1003: ERROR - Parse error. syntax error
                maskTemplate += "</span>") : (static = !0, maskTemplate += "<span class='im-static''>");
                             ^

Apr 09, 2018 11:29:18 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: D:\temp\jquery.inputmask.bundle.js:1010: ERROR - Parse error. missing variable name
                var maskTemplate = "", static = !1;
                                       ^

Apr 09, 2018 11:29:18 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 3 error(s), 0 warning(s)
Error message: JSC_PARSE_ERROR. Parse error. identifier is a reserved word at D:\temp\jquery.inputmask.bundle.js line 1002 : 16
Error message: JSC_PARSE_ERROR. Parse error. syntax error at D:\temp\jquery.inputmask.bundle.js line 1003 : 29
Error message: JSC_PARSE_ERROR. Parse error. missing variable name at D:\temp\jquery.inputmask.bundle.js line 1010 : 39

Full testing program and error logs can be seen at

this StackOverFlow question. Has there any way to work with these compilers ?

RobinHerbots commented 6 years ago

@cataclysmuprising ,

Which version do you use? Try with a newer version. of the inputmask.

cataclysmuprising commented 6 years ago

@RobinHerbots Thank you for quick response. I used Version: 3.3.4-108

RobinHerbots commented 6 years ago

@cataclysmuprising ,

See #1479