can we throw compilation error on trailing comma when using YUI javascript compressor

175 Views Asked by At

I am facing issue related to YUI compressor...its like during minification it does not throw error or warning if trailing comma is found like in json or config properties in EXT JS 3.4

So,,Can YUI throw such warning or I have to use some other compressor that can help me in this issue of trailing comma.I am using EXT JS and need to minify it. Plz help

1

There are 1 best solutions below

0
On BEST ANSWER

That is not the purpose of the compressor. A compressor will show error messages when the source cannot be compressed due to fatal syntax errors. A trailing comma is not a fatal error, it is, indeed, permitted by JS syntax, the problem is how browsers implement it. To warn you about such dubious interpretations, you have to use a syntax checker such as JSLint or JSHint.