entry_point_kinds only at source_index

This commit is contained in:
Dylan Conway
2023-05-02 22:16:46 -07:00
parent 1346293619
commit ca776326cf

View File

@@ -9890,19 +9890,17 @@ const LinkerContext = struct {
}
const records = this.import_records[source_index].slice();
const kind = this.entry_point_kinds[source_index];
for (this.export_star_records[source_index]) |id| {
const record = records[id];
if (record.source_index.isValid()) {
// This file has dynamic exports if the exported imports are from a file
// that either has dynamic exports directly or transitively by itself
// having an export star from a file with dynamic exports.
const kind = this.entry_point_kinds[record.source_index.get()];
if ((record.source_index.isInvalid() and (!kind.isEntryPoint() or !this.output_format.keepES6ImportExportSyntax())) or
(record.source_index.isValid() and record.source_index.get() != source_index and this.hasDynamicExportsDueToExportStar(record.source_index.get())))
{
this.exports_kind[source_index] = .esm_with_dynamic_fallback;
return true;
}
// This file has dynamic exports if the exported imports are from a file
// that either has dynamic exports directly or transitively by itself
// having an export star from a file with dynamic exports.
if ((record.source_index.isInvalid() and (!kind.isEntryPoint() or !this.output_format.keepES6ImportExportSyntax())) or
(record.source_index.isValid() and record.source_index.get() != source_index and this.hasDynamicExportsDueToExportStar(record.source_index.get())))
{
this.exports_kind[source_index] = .esm_with_dynamic_fallback;
return true;
}
}