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

Function parseClassBody

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

Source from the content-addressed store, hash-verified

8526 }
8527
8528 function parseClassBody() {
8529 var classElement, classElements = [], existingProps = {},
8530 marker = markerCreate(), propName, propType;
8531
8532 existingProps[ClassPropertyType["static"]] = new StringMap();
8533 existingProps[ClassPropertyType.prototype] = new StringMap();
8534
8535 expect('{');
8536
8537 while (index < length) {
8538 if (match('}')) {
8539 break;
8540 }
8541 classElement = parseClassElement(existingProps);
8542
8543 if (typeof classElement !== 'undefined') {
8544 classElements.push(classElement);
8545
8546 propName = !classElement.computed && getFieldName(classElement.key);
8547 if (propName !== false) {
8548 propType = classElement["static"] ?
8549 ClassPropertyType["static"] :
8550 ClassPropertyType.prototype;
8551
8552 if (classElement.type === Syntax.MethodDefinition) {
8553 if (propName === 'constructor' && !classElement["static"]) {
8554 if (specialMethod(classElement)) {
8555 throwError(classElement, Messages.IllegalClassConstructorProperty);
8556 }
8557 if (existingProps[ClassPropertyType.prototype].has('constructor')) {
8558 throwError(classElement.key, Messages.IllegalDuplicateClassProperty);
8559 }
8560 }
8561 existingProps[propType].set(propName, true);
8562 }
8563 }
8564 }
8565 }
8566
8567 expect('}');
8568
8569 return markerApply(marker, delegate.createClassBody(classElements));
8570 }
8571
8572 function parseClassImplements() {
8573 var id, implemented = [], marker, typeParameters;

Callers 2

parseClassExpressionFunction · 0.85
parseClassDeclarationFunction · 0.85

Calls 8

markerCreateFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85
parseClassElementFunction · 0.85
getFieldNameFunction · 0.85
specialMethodFunction · 0.85
throwErrorFunction · 0.85
markerApplyFunction · 0.85

Tested by

no test coverage detected