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

Method parseModuleSpecifier

src/parser.ts:3349–3359  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3347 // https://tc39.github.io/ecma262/#sec-imports
3348
3349 parseModuleSpecifier(): Node.Literal {
3350 const node = this.createNode();
3351
3352 if (this.lookahead.type !== Token.StringLiteral) {
3353 this.throwError(Messages.InvalidModuleSpecifier);
3354 }
3355
3356 const token = this.nextToken();
3357 const raw = this.getTokenRaw(token);
3358 return this.finalize(node, new Node.Literal(token.value as string, raw));
3359 }
3360
3361 // import {<foo as bar>} ...;
3362 parseImportSpecifier(): Node.ImportSpecifier {

Callers 2

Calls 5

createNodeMethod · 0.95
throwErrorMethod · 0.95
nextTokenMethod · 0.95
getTokenRawMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected