Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(semantic): incorrect ExportEntry span for ExportAllDeclaration in ModuleRecord #2793

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/oxc_semantic/src/module_record/builder.rs
Expand Up @@ -219,6 +219,7 @@ impl ModuleRecordBuilder {
exported_name.span(),
))
}),
span: decl.span,
..ExportEntry::default()
};
self.add_export_entry(export_entry);
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_semantic/src/module_record/mod.rs
Expand Up @@ -97,6 +97,7 @@ mod module_record_tests {
let export_entry = ExportEntry {
module_request: Some(NameSpan::new("mod".into(), Span::new(14, 19))),
import_name: ExportImportName::AllButDefault,
span: Span::new(0, 19),
..ExportEntry::default()
};
assert_eq!(module_record.star_export_entries.len(), 1);
Expand All @@ -112,6 +113,7 @@ mod module_record_tests {
module_request: Some(NameSpan::new("mod".into(), Span::new(20, 25))),
import_name: ExportImportName::All,
export_name: ExportExportName::Name(NameSpan::new("ns".into(), Span::new(12, 14))),
span: Span::new(0, 25),
..ExportEntry::default()
};
assert_eq!(module_record.indirect_export_entries.len(), 1);
Expand Down Expand Up @@ -268,7 +270,7 @@ mod module_record_tests {
module_record.indirect_export_entries[1],
ExportEntry {
module_request: Some(NameSpan::new("mod".into(), Span::new(57, 62))),
span: Span::new(0, 0),
span: Span::new(37, 63),
import_name: ExportImportName::All,
export_name: ExportExportName::Name(NameSpan::new("ns".into(), Span::new(49, 51))),
local_name: ExportLocalName::Null,
Expand Down