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

Method parseLexicalDeclaration

src/parser.ts:1886–1895  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1884 }
1885
1886 parseLexicalDeclaration(options): Node.VariableDeclaration {
1887 const node = this.createNode();
1888 const kind = this.nextToken().value as string;
1889 assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
1890
1891 const declarations = this.parseBindingList(kind, options);
1892 this.consumeSemicolon();
1893
1894 return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
1895 }
1896
1897 // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
1898

Callers 2

Calls 6

createNodeMethod · 0.95
nextTokenMethod · 0.95
parseBindingListMethod · 0.95
consumeSemicolonMethod · 0.95
finalizeMethod · 0.95
assertFunction · 0.90

Tested by

no test coverage detected