MCPcopy Index your code
hub / github.com/dchester/jsonpath / parsePostfixExpression

Function parsePostfixExpression

jsonpath.js:2341–2363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2339 // 11.3 Postfix Expressions
2340
2341 function parsePostfixExpression() {
2342 var expr, token, startToken = lookahead;
2343
2344 expr = parseLeftHandSideExpressionAllowCall();
2345
2346 if (lookahead.type === Token.Punctuator) {
2347 if ((match('++') || match('--')) && !peekLineTerminator()) {
2348 // 11.3.1, 11.3.2
2349 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
2350 throwErrorTolerant({}, Messages.StrictLHSPostfix);
2351 }
2352
2353 if (!isLeftHandSide(expr)) {
2354 throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
2355 }
2356
2357 token = lex();
2358 expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);
2359 }
2360 }
2361
2362 return expr;
2363 }
2364
2365 // 11.4 Unary Operators
2366

Callers 1

parseUnaryExpressionFunction · 0.85

Calls 7

matchFunction · 0.85
peekLineTerminatorFunction · 0.85
isRestrictedWordFunction · 0.85
throwErrorTolerantFunction · 0.85
isLeftHandSideFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected