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

Function parseModuleExportName

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

Source from the content-addressed store, hash-verified

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