(node)
| 3624 | // 12.9 The return statement |
| 3625 | |
| 3626 | function parseReturnStatement(node) { |
| 3627 | var argument = null; |
| 3628 | |
| 3629 | expectKeyword('return'); |
| 3630 | |
| 3631 | if (!state.inFunctionBody) { |
| 3632 | tolerateError(Messages.IllegalReturn); |
| 3633 | } |
| 3634 | |
| 3635 | // 'return' followed by a space and an identifier is very common. |
| 3636 | if (source.charCodeAt(lastIndex) === 0x20) { |
| 3637 | if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) { |
| 3638 | argument = parseExpression(); |
| 3639 | consumeSemicolon(); |
| 3640 | return node.finishReturnStatement(argument); |
| 3641 | } |
| 3642 | } |
| 3643 | |
| 3644 | if (hasLineTerminator) { |
| 3645 | // HACK |
| 3646 | return node.finishReturnStatement(null); |
| 3647 | } |
| 3648 | |
| 3649 | if (!match(';')) { |
| 3650 | if (!match('}') && lookahead.type !== Token.EOF) { |
| 3651 | argument = parseExpression(); |
| 3652 | } |
| 3653 | } |
| 3654 | |
| 3655 | consumeSemicolon(); |
| 3656 | |
| 3657 | return node.finishReturnStatement(argument); |
| 3658 | } |
| 3659 | |
| 3660 | // 12.10 The with statement |
| 3661 |
no test coverage detected