(hasProto)
| 2493 | } |
| 2494 | |
| 2495 | function parseObjectProperty(hasProto) { |
| 2496 | var token = lookahead, node = new Node(), computed, key, maybeMethod, value; |
| 2497 | |
| 2498 | computed = match('['); |
| 2499 | key = parseObjectPropertyKey(); |
| 2500 | maybeMethod = tryParseMethodDefinition(token, key, computed, node); |
| 2501 | |
| 2502 | if (maybeMethod) { |
| 2503 | checkProto(maybeMethod.key, maybeMethod.computed, hasProto); |
| 2504 | // finished |
| 2505 | return maybeMethod; |
| 2506 | } |
| 2507 | |
| 2508 | // init property or short hand property. |
| 2509 | checkProto(key, computed, hasProto); |
| 2510 | |
| 2511 | if (match(':')) { |
| 2512 | lex(); |
| 2513 | value = parseAssignmentExpression(); |
| 2514 | return node.finishProperty('init', key, computed, value, false, false); |
| 2515 | } |
| 2516 | |
| 2517 | if (token.type === Token.Identifier) { |
| 2518 | return node.finishProperty('init', key, computed, key, false, true); |
| 2519 | } |
| 2520 | |
| 2521 | throwUnexpectedToken(lookahead); |
| 2522 | } |
| 2523 | |
| 2524 | function parseObjectInitialiser() { |
| 2525 | var properties = [], hasProto = {value: false}, node = new Node(); |
no test coverage detected