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

Function parseParams

jsonpath.js:3354–3402  ·  view source on GitHub ↗
(firstRestricted)

Source from the content-addressed store, hash-verified

3352 }
3353
3354 function parseParams(firstRestricted) {
3355 var param, params = [], token, stricted, paramSet, key, message;
3356 expect('(');
3357
3358 if (!match(')')) {
3359 paramSet = {};
3360 while (index < length) {
3361 token = lookahead;
3362 param = parseVariableIdentifier();
3363 key = '$' + token.value;
3364 if (strict) {
3365 if (isRestrictedWord(token.value)) {
3366 stricted = token;
3367 message = Messages.StrictParamName;
3368 }
3369 if (Object.prototype.hasOwnProperty.call(paramSet, key)) {
3370 stricted = token;
3371 message = Messages.StrictParamDupe;
3372 }
3373 } else if (!firstRestricted) {
3374 if (isRestrictedWord(token.value)) {
3375 firstRestricted = token;
3376 message = Messages.StrictParamName;
3377 } else if (isStrictModeReservedWord(token.value)) {
3378 firstRestricted = token;
3379 message = Messages.StrictReservedWord;
3380 } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {
3381 firstRestricted = token;
3382 message = Messages.StrictParamDupe;
3383 }
3384 }
3385 params.push(param);
3386 paramSet[key] = true;
3387 if (match(')')) {
3388 break;
3389 }
3390 expect(',');
3391 }
3392 }
3393
3394 expect(')');
3395
3396 return {
3397 params: params,
3398 stricted: stricted,
3399 firstRestricted: firstRestricted,
3400 message: message
3401 };
3402 }
3403
3404 function parseFunctionDeclaration() {
3405 var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;

Callers 2

parseFunctionDeclarationFunction · 0.85
parseFunctionExpressionFunction · 0.85

Calls 5

expectFunction · 0.85
matchFunction · 0.85
parseVariableIdentifierFunction · 0.85
isRestrictedWordFunction · 0.85
isStrictModeReservedWordFunction · 0.85

Tested by

no test coverage detected