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

Function parseModuleExportName

packages/babel-parser/src/parser/statement.ts:2856–2868  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2854
2855 // https://tc39.es/ecma262/#prod-ModuleExportName
2856 parseModuleExportName(): N.StringLiteral | N.Identifier {
2857 if (this.match(tt.string)) {
2858 const result = this.parseStringLiteral(this.state.value);
2859 const surrogate = loneSurrogate.exec(result.value);
2860 if (surrogate) {
2861 this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
2862 surrogateCharCode: surrogate[0].charCodeAt(0),
2863 });
2864 }
2865 return result;
2866 }
2867 return this.parseIdentifier(true);
2868 }
2869
2870 // Converts the specifiers parsed in `{ ... }` to the list of names of a
2871 // filtered namespace (`{ ... } as ns`).

Callers

nothing calls this directly

Calls 3

matchMethod · 0.80
parseStringLiteralMethod · 0.80
parseIdentifierMethod · 0.80

Tested by

no test coverage detected