Reputation: 3117
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.
Upvotes: 0
Views: 694
Reputation: 5468
Your options are:
turn down the ES3
diagnostic group to warning or off
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
correct the code to remove the trailing commas.
Upvotes: 0
Reputation: 1506
default = {
Home:'',
Max: 5,
}
needs to be
default = {
Home:'',
Max: 5
}
Upvotes: 3