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

Function parseReturnStatement

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

Source from the content-addressed store, hash-verified

7691 // 12.9 The return statement
7692
7693 function parseReturnStatement() {
7694 var argument = null, marker = markerCreate();
7695
7696 expectKeyword('return');
7697
7698 if (!state.inFunctionBody) {
7699 throwErrorTolerant({}, Messages.IllegalReturn);
7700 }
7701
7702 // 'return' followed by a space and an identifier is very common.
7703 if (source.charCodeAt(index) === 32) {
7704 if (isIdentifierStart(source.charCodeAt(index + 1))) {
7705 argument = parseExpression();
7706 consumeSemicolon();
7707 return markerApply(marker, delegate.createReturnStatement(argument));
7708 }
7709 }
7710
7711 if (peekLineTerminator()) {
7712 return markerApply(marker, delegate.createReturnStatement(null));
7713 }
7714
7715 if (!match(';')) {
7716 if (!match('}') && lookahead.type !== Token.EOF) {
7717 argument = parseExpression();
7718 }
7719 }
7720
7721 consumeSemicolon();
7722
7723 return markerApply(marker, delegate.createReturnStatement(argument));
7724 }
7725
7726 // 12.10 The with statement
7727

Callers 1

parseStatementFunction · 0.85

Calls 9

markerCreateFunction · 0.85
expectKeywordFunction · 0.85
throwErrorTolerantFunction · 0.85
isIdentifierStartFunction · 0.85
parseExpressionFunction · 0.85
consumeSemicolonFunction · 0.85
markerApplyFunction · 0.85
peekLineTerminatorFunction · 0.85
matchFunction · 0.85

Tested by

no test coverage detected