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

Function parseExportSpecifier

packages/babel-parser/src/parser/statement.ts:2837–2853  ·  view source on GitHub ↗
(
    node: Undone<N.ExportSpecifier>,
    isString: boolean,
    /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript parser */
    isInTypeExport: boolean,
    isMaybeTypeOnly: boolean,
    /* eslint-enable @typescript-eslint/no-unused-vars */
  )

Source from the content-addressed store, hash-verified

2835 }
2836
2837 parseExportSpecifier(
2838 node: Undone<N.ExportSpecifier>,
2839 isString: boolean,
2840 /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript parser */
2841 isInTypeExport: boolean,
2842 isMaybeTypeOnly: boolean,
2843 /* eslint-enable @typescript-eslint/no-unused-vars */
2844 ): N.ExportSpecifier {
2845 if (this.eatContextual(tt._as)) {
2846 node.exported = this.parseModuleExportName();
2847 } else if (isString) {
2848 node.exported = this.cloneStringLiteral(node.local as N.StringLiteral);
2849 } else if (!node.exported) {
2850 node.exported = this.cloneIdentifier(node.local as N.Identifier);
2851 }
2852 return this.finishNode<N.ExportSpecifier>(node, "ExportSpecifier");
2853 }
2854
2855 // https://tc39.es/ecma262/#prod-ModuleExportName
2856 parseModuleExportName(): N.StringLiteral | N.Identifier {

Callers

nothing calls this directly

Calls 3

finishNodeMethod · 0.80
cloneStringLiteralMethod · 0.45
cloneIdentifierMethod · 0.45

Tested by

no test coverage detected