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

Function parseVariableDeclaration

jsonpath.js:2671–2691  ·  view source on GitHub ↗
(kind)

Source from the content-addressed store, hash-verified

2669 }
2670
2671 function parseVariableDeclaration(kind) {
2672 var init = null, id, startToken;
2673
2674 startToken = lookahead;
2675 id = parseVariableIdentifier();
2676
2677 // 12.2.1
2678 if (strict && isRestrictedWord(id.name)) {
2679 throwErrorTolerant({}, Messages.StrictVarName);
2680 }
2681
2682 if (kind === 'const') {
2683 expect('=');
2684 init = parseAssignmentExpression();
2685 } else if (match('=')) {
2686 lex();
2687 init = parseAssignmentExpression();
2688 }
2689
2690 return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);
2691 }
2692
2693 function parseVariableDeclarationList(kind) {
2694 var list = [];

Callers 1

Calls 7

parseVariableIdentifierFunction · 0.85
isRestrictedWordFunction · 0.85
throwErrorTolerantFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected