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

Function parseObjectPropertyKey

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

Source from the content-addressed store, hash-verified

5440
5441
5442 function parseObjectPropertyKey() {
5443 var marker = markerCreate(),
5444 token = lex(),
5445 propertyKey,
5446 result;
5447
5448 // Note: This function is called only from parseObjectProperty(), where
5449 // EOF and Punctuator tokens are already filtered out.
5450
5451 if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
5452 if (strict && token.octal) {
5453 throwErrorTolerant(token, Messages.StrictOctalLiteral);
5454 }
5455 return markerApply(marker, delegate.createLiteral(token));
5456 }
5457
5458 if (token.type === Token.Punctuator && token.value === '[') {
5459 // For computed properties we should skip the [ and ], and
5460 // capture in marker only the assignment expression itself.
5461 marker = markerCreate();
5462 propertyKey = parseAssignmentExpression();
5463 result = markerApply(marker, propertyKey);
5464 expect(']');
5465 return result;
5466 }
5467
5468 return markerApply(marker, delegate.createIdentifier(token.value));
5469 }
5470
5471 function parseObjectProperty() {
5472 var token, key, id, param, computed,

Callers 5

parseObjectPropertyFunction · 0.85
parseObjectTypeIndexerFunction · 0.85
parseObjectTypeFunction · 0.85
parseMethodDefinitionFunction · 0.85
parseClassElementFunction · 0.85

Calls 6

markerCreateFunction · 0.85
lexFunction · 0.85
throwErrorTolerantFunction · 0.85
markerApplyFunction · 0.85
expectFunction · 0.85

Tested by

no test coverage detected