()
| 1522 | // https://tc39.github.io/ecma262/#sec-conditional-operator |
| 1523 | |
| 1524 | parseConditionalExpression(): Node.Expression { |
| 1525 | const startToken = this.lookahead; |
| 1526 | |
| 1527 | let expr = this.inheritCoverGrammar(this.parseBinaryExpression); |
| 1528 | if (this.match('?')) { |
| 1529 | this.nextToken(); |
| 1530 | |
| 1531 | const previousAllowIn = this.context.allowIn; |
| 1532 | this.context.allowIn = true; |
| 1533 | const consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); |
| 1534 | this.context.allowIn = previousAllowIn; |
| 1535 | |
| 1536 | this.expect(':'); |
| 1537 | const alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); |
| 1538 | |
| 1539 | expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); |
| 1540 | this.context.isAssignmentTarget = false; |
| 1541 | this.context.isBindingElement = false; |
| 1542 | } |
| 1543 | |
| 1544 | return expr; |
| 1545 | } |
| 1546 | |
| 1547 | // https://tc39.github.io/ecma262/#sec-assignment-operators |
| 1548 |
no test coverage detected