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

Function parseImportSourceAndAttributes

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

Source from the content-addressed store, hash-verified

3119 }
3120
3121 parseImportSourceAndAttributes(
3122 this: Parser,
3123 node: Undone<N.ImportDeclaration>,
3124 ): N.ImportDeclaration {
3125 node.specifiers ??= [];
3126 node.source = this.parseImportSource();
3127 this.maybeParseImportAttributes(node);
3128 this.checkImportPhase(node);
3129
3130 this.semicolon();
3131 this.sawUnambiguousESM = true;
3132 return this.finishNode(node, "ImportDeclaration");
3133 }
3134
3135 parseImportSource(this: Parser): N.StringLiteral {
3136 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