()
| 2373 | } |
| 2374 | |
| 2375 | function parseObjectPropertyKey() { |
| 2376 | var token, node = new Node(), expr; |
| 2377 | |
| 2378 | token = lex(); |
| 2379 | |
| 2380 | // Note: This function is called only from parseObjectProperty(), where |
| 2381 | // EOF and Punctuator tokens are already filtered out. |
| 2382 | |
| 2383 | switch (token.type) { |
| 2384 | case Token.StringLiteral: |
| 2385 | case Token.NumericLiteral: |
| 2386 | if (strict && token.octal) { |
| 2387 | tolerateUnexpectedToken(token, Messages.StrictOctalLiteral); |
| 2388 | } |
| 2389 | return node.finishLiteral(token); |
| 2390 | case Token.Identifier: |
| 2391 | case Token.BooleanLiteral: |
| 2392 | case Token.NullLiteral: |
| 2393 | case Token.Keyword: |
| 2394 | return node.finishIdentifier(token.value); |
| 2395 | case Token.Punctuator: |
| 2396 | if (token.value === '[') { |
| 2397 | expr = parseAssignmentExpression(); |
| 2398 | expect(']'); |
| 2399 | return expr; |
| 2400 | } |
| 2401 | break; |
| 2402 | } |
| 2403 | throwUnexpectedToken(token); |
| 2404 | } |
| 2405 | |
| 2406 | function lookaheadPropertyName() { |
| 2407 | switch (lookahead.type) { |
no test coverage detected