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

StackOverflow https://stackoverflow.com/questions/20738379

  •  20-09-2022
  •  | 
  •  

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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top