MCPcopy Create free account
hub / github.com/dchester/jsonpath / parseObjectPropertyKey

Function parseObjectPropertyKey

jsonpath.js:2037–2054  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2035 }
2036
2037 function parseObjectPropertyKey() {
2038 var token, startToken;
2039
2040 startToken = lookahead;
2041 token = lex();
2042
2043 // Note: This function is called only from parseObjectProperty(), where
2044 // EOF and Punctuator tokens are already filtered out.
2045
2046 if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
2047 if (strict && token.octal) {
2048 throwErrorTolerant(token, Messages.StrictOctalLiteral);
2049 }
2050 return delegate.markEnd(delegate.createLiteral(token), startToken);
2051 }
2052
2053 return delegate.markEnd(delegate.createIdentifier(token.value), startToken);
2054 }
2055
2056 function parseObjectProperty() {
2057 var token, key, id, value, param, startToken;

Callers 1

parseObjectPropertyFunction · 0.85

Calls 2

throwErrorTolerantFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected