MCPcopy Index your code
hub / github.com/reactjs/react-rails / parseBreakStatement

Function parseBreakStatement

lib/assets/javascripts/JSXTransformer.js:7650–7689  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7648 // 12.8 The break statement
7649
7650 function parseBreakStatement() {
7651 var label = null, marker = markerCreate();
7652
7653 expectKeyword('break');
7654
7655 // Catch the very common case first: immediately a semicolon (char #59).
7656 if (source.charCodeAt(index) === 59) {
7657 lex();
7658
7659 if (!(state.inIteration || state.inSwitch)) {
7660 throwError({}, Messages.IllegalBreak);
7661 }
7662
7663 return markerApply(marker, delegate.createBreakStatement(null));
7664 }
7665
7666 if (peekLineTerminator()) {
7667 if (!(state.inIteration || state.inSwitch)) {
7668 throwError({}, Messages.IllegalBreak);
7669 }
7670
7671 return markerApply(marker, delegate.createBreakStatement(null));
7672 }
7673
7674 if (lookahead.type === Token.Identifier) {
7675 label = parseVariableIdentifier();
7676
7677 if (!state.labelSet.has(label.name)) {
7678 throwError({}, Messages.UnknownLabel, label.name);
7679 }
7680 }
7681
7682 consumeSemicolon();
7683
7684 if (label === null && !(state.inIteration || state.inSwitch)) {
7685 throwError({}, Messages.IllegalBreak);
7686 }
7687
7688 return markerApply(marker, delegate.createBreakStatement(label));
7689 }
7690
7691 // 12.9 The return statement
7692

Callers 1

parseStatementFunction · 0.85

Calls 8

markerCreateFunction · 0.85
expectKeywordFunction · 0.85
lexFunction · 0.85
throwErrorFunction · 0.85
markerApplyFunction · 0.85
peekLineTerminatorFunction · 0.85
parseVariableIdentifierFunction · 0.85
consumeSemicolonFunction · 0.85

Tested by

no test coverage detected