()
| 2909 | // 12.7 The continue statement |
| 2910 | |
| 2911 | function parseContinueStatement() { |
| 2912 | var label = null, key; |
| 2913 | |
| 2914 | expectKeyword('continue'); |
| 2915 | |
| 2916 | // Optimize the most common form: 'continue;'. |
| 2917 | if (source.charCodeAt(index) === 0x3B) { |
| 2918 | lex(); |
| 2919 | |
| 2920 | if (!state.inIteration) { |
| 2921 | throwError({}, Messages.IllegalContinue); |
| 2922 | } |
| 2923 | |
| 2924 | return delegate.createContinueStatement(null); |
| 2925 | } |
| 2926 | |
| 2927 | if (peekLineTerminator()) { |
| 2928 | if (!state.inIteration) { |
| 2929 | throwError({}, Messages.IllegalContinue); |
| 2930 | } |
| 2931 | |
| 2932 | return delegate.createContinueStatement(null); |
| 2933 | } |
| 2934 | |
| 2935 | if (lookahead.type === Token.Identifier) { |
| 2936 | label = parseVariableIdentifier(); |
| 2937 | |
| 2938 | key = '$' + label.name; |
| 2939 | if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { |
| 2940 | throwError({}, Messages.UnknownLabel, label.name); |
| 2941 | } |
| 2942 | } |
| 2943 | |
| 2944 | consumeSemicolon(); |
| 2945 | |
| 2946 | if (label === null && !state.inIteration) { |
| 2947 | throwError({}, Messages.IllegalContinue); |
| 2948 | } |
| 2949 | |
| 2950 | return delegate.createContinueStatement(label); |
| 2951 | } |
| 2952 | |
| 2953 | // 12.8 The break statement |
| 2954 |
no test coverage detected