0

I want take shorten my JS, but Errors appear while compiling.

Error warning from points like :

default = {
        Home:'',
        Max: 5,
}

or

items: {
     visible: 1,
     width: 200
      }

Waring Msg :

JSC_TRAILING_COMMA: Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option. at line 162 character 0
visible: 1,

JSC_TRAILING_COMMA: Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option. at line 249 character 0
Home:'',

Say me how to solve this error.

user207421
  • 305,947
  • 44
  • 307
  • 483
Hai Tien
  • 2,929
  • 7
  • 36
  • 55
  • 1
    maybe, just maybe, getting rid of the trailing commas mentioned in the warnings will make the warnings go away. – Kevin B Nov 14 '13 at 20:50

2 Answers2

3
default = {
    Home:'',
    Max: 5,

}

needs to be

default = {
    Home:'',
    Max: 5

}

dwaddell
  • 1,446
  • 12
  • 22
0

Your options are:

  1. turn down the ES3 diagnostic group to warning or off

  2. change the language mode to ECMASCRIPT5 or ECMASCRIPT5_STRICT. EcmaScript 5 standardized trailing comma behavior but IE8 and below will produce syntax errors if you try to run the code uncompiled

  3. correct the code to remove the trailing commas.

John
  • 5,443
  • 15
  • 21