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

Method parseRestElement

src/parser.ts:2784–2797  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

2782 }
2783
2784 parseRestElement(params): Node.RestElement {
2785 const node = this.createNode();
2786
2787 this.expect('...');
2788 const arg = this.parsePattern(params);
2789 if (this.match('=')) {
2790 this.throwError(Messages.DefaultRestParameter);
2791 }
2792 if (!this.match(')')) {
2793 this.throwError(Messages.ParameterAfterRestParameter);
2794 }
2795
2796 return this.finalize(node, new Node.RestElement(arg));
2797 }
2798
2799 parseFormalParameter(options) {
2800 const params: any[] = [];

Callers 2

parseGroupExpressionMethod · 0.95
parseFormalParameterMethod · 0.95

Calls 6

createNodeMethod · 0.95
expectMethod · 0.95
parsePatternMethod · 0.95
matchMethod · 0.95
throwErrorMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected