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

Function parseAssignmentExpression

jsonpath.js:2572–2597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2570 // 11.13 Assignment Operators
2571
2572 function parseAssignmentExpression() {
2573 var token, left, right, node, startToken;
2574
2575 token = lookahead;
2576 startToken = lookahead;
2577
2578 node = left = parseConditionalExpression();
2579
2580 if (matchAssign()) {
2581 // LeftHandSideExpression
2582 if (!isLeftHandSide(left)) {
2583 throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
2584 }
2585
2586 // 11.13.1
2587 if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {
2588 throwErrorTolerant(token, Messages.StrictLHSAssignment);
2589 }
2590
2591 token = lex();
2592 right = parseAssignmentExpression();
2593 node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);
2594 }
2595
2596 return node;
2597 }
2598
2599 // 11.14 Comma Operator
2600

Callers 6

parseArrayInitialiserFunction · 0.85
parseObjectPropertyFunction · 0.85
parseArgumentsFunction · 0.85
parseExpressionFunction · 0.85
parseVariableDeclarationFunction · 0.85

Calls 6

matchAssignFunction · 0.85
isLeftHandSideFunction · 0.85
throwErrorTolerantFunction · 0.85
isRestrictedWordFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected