Skip to content

Commit 519f977

Browse files
committed
Extract parameters
1 parent d459c8b commit 519f977

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

packages/babel-parser/src/parser/statement.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,18 +2167,29 @@ export default class StatementParser extends ExpressionParser {
21672167
this.expect(tt.comma);
21682168
if (this.eat(tt.braceR)) break;
21692169
}
2170-
const node = this.parseExportSpecifier(isInTypeExport);
2170+
const isMaybeTypeOnly = this.isContextual(tt._type);
2171+
const isString = this.match(tt.string);
2172+
const local = this.parseModuleExportName();
2173+
const node = this.parseExportSpecifier(
2174+
local,
2175+
isString,
2176+
isInTypeExport,
2177+
isMaybeTypeOnly,
2178+
);
21712179
nodes.push(node);
21722180
}
21732181

21742182
return nodes;
21752183
}
21762184

2177-
parseExportSpecifier(isInTypeExport: boolean): N.ExportSpecifier {
2178-
const node = this.startNode();
2179-
const isMaybeTypeOnly = this.isContextual(tt._type);
2180-
const isString = this.match(tt.string);
2181-
node.local = this.parseModuleExportName();
2185+
parseExportSpecifier(
2186+
local: N.StringLiteral | N.Identifier,
2187+
isString: boolean,
2188+
isInTypeExport: boolean,
2189+
isMaybeTypeOnly: boolean,
2190+
): N.ExportSpecifier {
2191+
const node = this.startNodeAtNode(local);
2192+
node.local = local;
21822193
const canParseAsKeyword = this.parseTypeOnlyImportExportSpecifier(
21832194
node,
21842195
/* isImport */ false,

0 commit comments

Comments
 (0)