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

Function parseClassElement

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

Source from the content-addressed store, hash-verified

8484 }
8485
8486 function parseClassElement() {
8487 var computed = false, generator = false, key, marker = markerCreate(),
8488 isStatic = false, possiblyOpenBracketToken;
8489 if (match(';')) {
8490 lex();
8491 return undefined;
8492 }
8493
8494 if (lookahead.value === 'static') {
8495 lex();
8496 isStatic = true;
8497 }
8498
8499 if (match('*')) {
8500 lex();
8501 generator = true;
8502 }
8503
8504 possiblyOpenBracketToken = lookahead;
8505 if (matchContextualKeyword('get') || matchContextualKeyword('set')) {
8506 possiblyOpenBracketToken = lookahead2();
8507 }
8508
8509 if (possiblyOpenBracketToken.type === Token.Punctuator
8510 && possiblyOpenBracketToken.value === '[') {
8511 computed = true;
8512 }
8513
8514 key = parseObjectPropertyKey();
8515
8516 if (!generator && lookahead.value === ':') {
8517 return markerApply(marker, parseClassProperty(key, computed, isStatic));
8518 }
8519
8520 return markerApply(marker, parseMethodDefinition(
8521 key,
8522 isStatic,
8523 generator,
8524 computed
8525 ));
8526 }
8527
8528 function parseClassBody() {
8529 var classElement, classElements = [], existingProps = {},

Callers 1

parseClassBodyFunction · 0.85

Calls 9

markerCreateFunction · 0.85
matchFunction · 0.85
lexFunction · 0.85
matchContextualKeywordFunction · 0.85
lookahead2Function · 0.85
parseObjectPropertyKeyFunction · 0.85
markerApplyFunction · 0.85
parseClassPropertyFunction · 0.85
parseMethodDefinitionFunction · 0.85

Tested by

no test coverage detected