1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibJS: Only check for duplicate exports if they have a name

Together with removing an incorrect VERIFY this allows multiple star
imports in a single module.
This commit is contained in:
davidot 2022-09-01 22:55:02 +02:00 committed by Linus Groh
parent 3b56043612
commit 462c6df24b
4 changed files with 9 additions and 3 deletions

View file

@ -4498,7 +4498,7 @@ bool ExportStatement::has_export(FlyString const& export_name) const
{
return any_of(m_entries.begin(), m_entries.end(), [&](auto& entry) {
// Make sure that empty exported names does not overlap with anything
if (entry.kind == ExportEntry::Kind::EmptyNamedExport)
if (entry.kind != ExportEntry::Kind::NamedExport)
return false;
return entry.export_name == export_name;
});