()
| 5440 | |
| 5441 | |
| 5442 | function parseObjectPropertyKey() { |
| 5443 | var marker = markerCreate(), |
| 5444 | token = lex(), |
| 5445 | propertyKey, |
| 5446 | result; |
| 5447 | |
| 5448 | // Note: This function is called only from parseObjectProperty(), where |
| 5449 | // EOF and Punctuator tokens are already filtered out. |
| 5450 | |
| 5451 | if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { |
| 5452 | if (strict && token.octal) { |
| 5453 | throwErrorTolerant(token, Messages.StrictOctalLiteral); |
| 5454 | } |
| 5455 | return markerApply(marker, delegate.createLiteral(token)); |
| 5456 | } |
| 5457 | |
| 5458 | if (token.type === Token.Punctuator && token.value === '[') { |
| 5459 | // For computed properties we should skip the [ and ], and |
| 5460 | // capture in marker only the assignment expression itself. |
| 5461 | marker = markerCreate(); |
| 5462 | propertyKey = parseAssignmentExpression(); |
| 5463 | result = markerApply(marker, propertyKey); |
| 5464 | expect(']'); |
| 5465 | return result; |
| 5466 | } |
| 5467 | |
| 5468 | return markerApply(marker, delegate.createIdentifier(token.value)); |
| 5469 | } |
| 5470 | |
| 5471 | function parseObjectProperty() { |
| 5472 | var token, key, id, param, computed, |
no test coverage detected