Fix namespaceSpecifier not being added to ExportExternalDeclaration - fixes
MODIFY
packages/@romejs/js-parser/parser/modules.ts
packages/@romejs/js-parser/parser/modules.ts
@@ -511,11 +511,15 @@ function parseExportStar(
parser.expect(tt.star);
if (parser.isContextual('as')) {
- const {source, namedSpecifiers} = parseExportNamespace(parser, exportKind);
+ const {source, namespaceSpecifier, namedSpecifiers} = parseExportNamespace(
+ parser,
+ exportKind,
+ );
return parser.finishNode(
start,
{
type: 'ExportExternalDeclaration',
+ namespaceSpecifier,
exportKind,
namedSpecifiers,
source,

MODIFY
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns-and-named/input.test.md
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns-and-named/input.test.md
@@ -61,6 +61,38 @@ Program {
}
}
}
+ namespaceSpecifier: ExportNamespaceSpecifier {
+ loc: Object {
+ filename: 'input.js'
+ end: Object {
+ column: 15
+ index: 15
+ line: 1
+ }
+ start: Object {
+ column: 7
+ index: 7
+ line: 1
+ }
+ }
+ exported: Identifier {
+ name: 'foo'
+ loc: Object {
+ filename: 'input.js'
+ identifierName: 'foo'
+ end: Object {
+ column: 15
+ index: 15
+ line: 1
+ }
+ start: Object {
+ column: 12
+ index: 12
+ line: 1
+ }
+ }
+ }
+ }
namedSpecifiers: Array [
ExportExternalSpecifier {
loc: Object {

MODIFY
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns-default/input.test.md
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns-default/input.test.md
@@ -62,6 +62,38 @@ Program {
}
}
}
+ namespaceSpecifier: ExportNamespaceSpecifier {
+ loc: Object {
+ filename: 'input.js'
+ end: Object {
+ column: 19
+ index: 19
+ line: 1
+ }
+ start: Object {
+ column: 7
+ index: 7
+ line: 1
+ }
+ }
+ exported: Identifier {
+ name: 'default'
+ loc: Object {
+ filename: 'input.js'
+ identifierName: 'default'
+ end: Object {
+ column: 19
+ index: 19
+ line: 1
+ }
+ start: Object {
+ column: 12
+ index: 12
+ line: 1
+ }
+ }
+ }
+ }
}
]
}

MODIFY
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns/input.test.md
packages/@romejs/js-parser/test-fixtures/experimental/export-extensions/ns/input.test.md
@@ -62,6 +62,38 @@ Program {
}
}
}
+ namespaceSpecifier: ExportNamespaceSpecifier {
+ loc: Object {
+ filename: 'input.js'
+ end: Object {
+ column: 13
+ index: 13
+ line: 1
+ }
+ start: Object {
+ column: 7
+ index: 7
+ line: 1
+ }
+ }
+ exported: Identifier {
+ name: 'A'
+ loc: Object {
+ filename: 'input.js'
+ identifierName: 'A'
+ end: Object {
+ column: 13
+ index: 13
+ line: 1
+ }
+ start: Object {
+ column: 12
+ index: 12
+ line: 1
+ }
+ }
+ }
+ }
}
]
}

MODIFY
packages/@romejs/js-parser/test-fixtures/flow/declare-export/export-star-as/input.test.md
packages/@romejs/js-parser/test-fixtures/flow/declare-export/export-star-as/input.test.md
@@ -65,6 +65,38 @@ Program {
}
}
}
+ namespaceSpecifier: ExportNamespaceSpecifier {
+ loc: Object {
+ filename: 'input.js'
+ end: Object {
+ column: 24
+ index: 24
+ line: 1
+ }
+ start: Object {
+ column: 15
+ index: 15
+ line: 1
+ }
+ }
+ exported: Identifier {
+ name: 'test'
+ loc: Object {
+ filename: 'input.js'
+ identifierName: 'test'
+ end: Object {
+ column: 24
+ index: 24
+ line: 1
+ }
+ start: Object {
+ column: 20
+ index: 20
+ line: 1
+ }
+ }
+ }
+ }
}
]
}

MODIFY
packages/@romejs/js-parser/test-fixtures/flow/type-exports/star-as-from/input.test.md
packages/@romejs/js-parser/test-fixtures/flow/type-exports/star-as-from/input.test.md
@@ -85,6 +85,38 @@ Program {
}
}
}
+ namespaceSpecifier: ExportNamespaceSpecifier {
+ loc: Object {
+ filename: 'input.js'
+ end: Object {
+ column: 25
+ index: 25
+ line: 1
+ }
+ start: Object {
+ column: 12
+ index: 12
+ line: 1
+ }
+ }
+ exported: Identifier {
+ name: 'fooTypes'
+ loc: Object {
+ filename: 'input.js'
+ identifierName: 'fooTypes'
+ end: Object {
+ column: 25
+ index: 25
+ line: 1
+ }
+ start: Object {
+ column: 17
+ index: 17
+ line: 1
+ }
+ }
+ }
+ }
}
]
}

Fix namespaceSpecifier not being added to ExportExternalDeclaration - fixes #390