MCPcopy Create free account
hub / github.com/babel/babel / parseImportSourceAndAttributes

Function parseImportSourceAndAttributes

packages/babel-parser/src/parser/statement.ts:3117–3129  ·  view source on GitHub ↗
(
    this: Parser,
    node: Undone<N.ImportDeclaration>,
  )

Source from the content-addressed store, hash-verified

3115 }
3116
3117 parseImportSourceAndAttributes(
3118 this: Parser,
3119 node: Undone<N.ImportDeclaration>,
3120 ): N.ImportDeclaration {
3121 node.specifiers ??= [];
3122 node.source = this.parseImportSource();
3123 this.maybeParseImportAttributes(node);
3124 this.checkImportPhase(node);
3125
3126 this.semicolon();
3127 this.sawUnambiguousESM = true;
3128 return this.finishNode(node, "ImportDeclaration");
3129 }
3130
3131 parseImportSource(this: Parser): N.StringLiteral {
3132 if (!this.match(tt.string)) this.unexpected();

Callers

nothing calls this directly

Calls 3

parseImportSourceMethod · 0.80
finishNodeMethod · 0.80
semicolonMethod · 0.45

Tested by

no test coverage detected