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

Function parseClassExpression

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

Source from the content-addressed store, hash-verified

8597 }
8598
8599 function parseClassExpression() {
8600 var id, implemented, previousYieldAllowed, superClass = null,
8601 superTypeParameters, marker = markerCreate(), typeParameters,
8602 matchImplements;
8603
8604 expectKeyword('class');
8605
8606 matchImplements =
8607 strict
8608 ? matchKeyword('implements')
8609 : matchContextualKeyword('implements');
8610
8611 if (!matchKeyword('extends') && !matchImplements && !match('{')) {
8612 id = parseVariableIdentifier();
8613 }
8614
8615 if (match('<')) {
8616 typeParameters = parseTypeParameterDeclaration();
8617 }
8618
8619 if (matchKeyword('extends')) {
8620 expectKeyword('extends');
8621 previousYieldAllowed = state.yieldAllowed;
8622 state.yieldAllowed = false;
8623 superClass = parseLeftHandSideExpressionAllowCall();
8624 if (match('<')) {
8625 superTypeParameters = parseTypeParameterInstantiation();
8626 }
8627 state.yieldAllowed = previousYieldAllowed;
8628 }
8629
8630 if (strict ? matchKeyword('implements') : matchContextualKeyword('implements')) {
8631 implemented = parseClassImplements();
8632 }
8633
8634 return markerApply(marker, delegate.createClassExpression(
8635 id,
8636 superClass,
8637 parseClassBody(),
8638 typeParameters,
8639 superTypeParameters,
8640 implemented
8641 ));
8642 }
8643
8644 function parseClassDeclaration() {
8645 var id, implemented, previousYieldAllowed, superClass = null,

Callers 2

parsePrimaryExpressionFunction · 0.85
parseExportDeclarationFunction · 0.85

Calls 12

markerCreateFunction · 0.85
expectKeywordFunction · 0.85
matchKeywordFunction · 0.85
matchContextualKeywordFunction · 0.85
matchFunction · 0.85
parseVariableIdentifierFunction · 0.85
parseClassImplementsFunction · 0.85
markerApplyFunction · 0.85
parseClassBodyFunction · 0.85

Tested by

no test coverage detected