When files processed with smoosh (UglifyJS) are concatenated to other files, there may be a bug because of a missing semicolon at the end of the compressed output. I encountered this problem when using ded/domready's minified version, which has been created with smoosh.
The exact error is: TypeError: (intermediate value)(...) is not a function.
Here is a fiddle which demonstrates the error with the smoosh output of ded/domready + some example code. The fix is also demonstrated.
The fix is directly taken from the UglifyJS source code. It has to be taken care of in smoosh's code too because smoosh directly uses the UglifyJS v1 API. In UglifyJS, the semicolon is also added after the gen_code(ast) call.
When files processed with smoosh (UglifyJS) are concatenated to other files, there may be a bug because of a missing semicolon at the end of the compressed output. I encountered this problem when using ded/domready's minified version, which has been created with smoosh.
TypeError: (intermediate value)(...) is not a function
.The fix is directly taken from the UglifyJS source code. It has to be taken care of in smoosh's code too because smoosh directly uses the UglifyJS v1 API. In UglifyJS, the semicolon is also added after the gen_code(ast) call.