* @name expectCommaSeparator * @description Quietly expect a comma when in tolerant mode, otherwise delegates * to expect(value) * @since 2.0
()
| 2140 | * @since 2.0 |
| 2141 | */ |
| 2142 | function expectCommaSeparator() { |
| 2143 | var token; |
| 2144 | |
| 2145 | if (extra.errors) { |
| 2146 | token = lookahead; |
| 2147 | if (token.type === Token.Punctuator && token.value === ',') { |
| 2148 | lex(); |
| 2149 | } else if (token.type === Token.Punctuator && token.value === ';') { |
| 2150 | lex(); |
| 2151 | tolerateUnexpectedToken(token); |
| 2152 | } else { |
| 2153 | tolerateUnexpectedToken(token, Messages.UnexpectedToken); |
| 2154 | } |
| 2155 | } else { |
| 2156 | expect(','); |
| 2157 | } |
| 2158 | } |
| 2159 | |
| 2160 | // Expect the next token to match the specified keyword. |
| 2161 | // If not, an exception will be thrown. |
no test coverage detected