MCPcopy
hub / github.com/jquery/esprima / parseFormalParameters

Method parseFormalParameters

src/parser.ts:2809–2841  ·  view source on GitHub ↗
(firstRestricted?)

Source from the content-addressed store, hash-verified

2807 }
2808
2809 parseFormalParameters(firstRestricted?) {
2810 let options;
2811
2812 options = {
2813 simple: true,
2814 params: [],
2815 firstRestricted: firstRestricted
2816 };
2817
2818 this.expect('(');
2819 if (!this.match(')')) {
2820 options.paramSet = {};
2821 while (this.lookahead.type !== Token.EOF) {
2822 this.parseFormalParameter(options);
2823 if (this.match(')')) {
2824 break;
2825 }
2826 this.expect(',');
2827 if (this.match(')')) {
2828 break;
2829 }
2830 }
2831 }
2832 this.expect(')');
2833
2834 return {
2835 simple: options.simple,
2836 params: options.params,
2837 stricted: options.stricted,
2838 firstRestricted: options.firstRestricted,
2839 message: options.message
2840 };
2841 }
2842
2843 matchAsyncFunction(): boolean {
2844 let match = this.matchContextualKeyword('async');

Callers 7

parseGetterMethodMethod · 0.95
parseSetterMethodMethod · 0.95
parseGeneratorMethodMethod · 0.95

Calls 3

expectMethod · 0.95
matchMethod · 0.95
parseFormalParameterMethod · 0.95

Tested by

no test coverage detected