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

Function parseJSXAttributeValue

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

Source from the content-addressed store, hash-verified

9267 }
9268
9269 function parseJSXAttributeValue() {
9270 var value, marker;
9271 if (match('{')) {
9272 value = parseJSXExpressionContainer();
9273 if (value.expression.type === Syntax.JSXEmptyExpression) {
9274 throwError(
9275 value,
9276 'JSX attributes must only be assigned a non-empty ' +
9277 'expression'
9278 );
9279 }
9280 } else if (match('<')) {
9281 value = parseJSXElement();
9282 } else if (lookahead.type === Token.JSXText) {
9283 marker = markerCreate();
9284 value = markerApply(marker, delegate.createLiteral(lex()));
9285 } else {
9286 throwError({}, Messages.InvalidJSXAttributeValue);
9287 }
9288 return value;
9289 }
9290
9291 function parseJSXEmptyExpression() {
9292 var marker = markerCreatePreserveWhitespace();

Callers 1

parseJSXAttributeFunction · 0.85

Calls 7

matchFunction · 0.85
throwErrorFunction · 0.85
parseJSXElementFunction · 0.85
markerCreateFunction · 0.85
markerApplyFunction · 0.85
lexFunction · 0.85

Tested by

no test coverage detected