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

Function parseExportSpecifier

packages/babel-parser/src/parser/statement.ts:2841–2857  ·  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

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