(opts)
| 3180 | } |
| 3181 | |
| 3182 | function comma(opts) { |
| 3183 | opts = opts || {}; |
| 3184 | |
| 3185 | if (state.option.nocomma) { |
| 3186 | warning("W127"); |
| 3187 | } |
| 3188 | |
| 3189 | if (!opts.peek) { |
| 3190 | nobreakcomma(state.tokens.curr, state.tokens.next); |
| 3191 | advance(","); |
| 3192 | } else { |
| 3193 | nobreakcomma(state.tokens.prev, state.tokens.curr); |
| 3194 | } |
| 3195 | |
| 3196 | if (state.tokens.next.identifier && !(opts.property && state.option.inES5())) { |
| 3197 | switch (state.tokens.next.value) { |
| 3198 | case "break": |
| 3199 | case "case": |
| 3200 | case "catch": |
| 3201 | case "continue": |
| 3202 | case "default": |
| 3203 | case "do": |
| 3204 | case "else": |
| 3205 | case "finally": |
| 3206 | case "for": |
| 3207 | case "if": |
| 3208 | case "in": |
| 3209 | case "instanceof": |
| 3210 | case "return": |
| 3211 | case "switch": |
| 3212 | case "throw": |
| 3213 | case "try": |
| 3214 | case "var": |
| 3215 | case "let": |
| 3216 | case "while": |
| 3217 | case "with": |
| 3218 | error("E024", state.tokens.next, state.tokens.next.value); |
| 3219 | return false; |
| 3220 | } |
| 3221 | } |
| 3222 | |
| 3223 | if (state.tokens.next.type === "(punctuator)") { |
| 3224 | switch (state.tokens.next.value) { |
| 3225 | case "}": |
| 3226 | case "]": |
| 3227 | case ",": |
| 3228 | if (opts.allowTrailing) { |
| 3229 | return true; |
| 3230 | } |
| 3231 | case ")": |
| 3232 | error("E024", state.tokens.next, state.tokens.next.value); |
| 3233 | return false; |
| 3234 | } |
| 3235 | } |
| 3236 | return true; |
| 3237 | } |
| 3238 | |
| 3239 | function symbol(s, p) { |
no test coverage detected