()
| 7605 | // 12.7 The continue statement |
| 7606 | |
| 7607 | function parseContinueStatement() { |
| 7608 | var label = null, marker = markerCreate(); |
| 7609 | |
| 7610 | expectKeyword('continue'); |
| 7611 | |
| 7612 | // Optimize the most common form: 'continue;'. |
| 7613 | if (source.charCodeAt(index) === 59) { |
| 7614 | lex(); |
| 7615 | |
| 7616 | if (!state.inIteration) { |
| 7617 | throwError({}, Messages.IllegalContinue); |
| 7618 | } |
| 7619 | |
| 7620 | return markerApply(marker, delegate.createContinueStatement(null)); |
| 7621 | } |
| 7622 | |
| 7623 | if (peekLineTerminator()) { |
| 7624 | if (!state.inIteration) { |
| 7625 | throwError({}, Messages.IllegalContinue); |
| 7626 | } |
| 7627 | |
| 7628 | return markerApply(marker, delegate.createContinueStatement(null)); |
| 7629 | } |
| 7630 | |
| 7631 | if (lookahead.type === Token.Identifier) { |
| 7632 | label = parseVariableIdentifier(); |
| 7633 | |
| 7634 | if (!state.labelSet.has(label.name)) { |
| 7635 | throwError({}, Messages.UnknownLabel, label.name); |
| 7636 | } |
| 7637 | } |
| 7638 | |
| 7639 | consumeSemicolon(); |
| 7640 | |
| 7641 | if (label === null && !state.inIteration) { |
| 7642 | throwError({}, Messages.IllegalContinue); |
| 7643 | } |
| 7644 | |
| 7645 | return markerApply(marker, delegate.createContinueStatement(label)); |
| 7646 | } |
| 7647 | |
| 7648 | // 12.8 The break statement |
| 7649 |
no test coverage detected