mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Handle empty named export
This is an export which looks like `export {} from "module"`, and although it doesn't have any real export entries it should still add "module" to the required modules to load.
This commit is contained in:
parent
f75c51b097
commit
3b1c3e574f
Notes:
sideshowbarker
2024-07-18 03:20:18 +09:00
Author: https://github.com/davidot
Commit: 3b1c3e574f
Pull-request: https://github.com/SerenityOS/serenity/pull/15100
Reviewed-by: https://github.com/linusg
10 changed files with 60 additions and 2 deletions
|
@ -174,6 +174,13 @@ Result<NonnullRefPtr<SourceTextModule>, Vector<Parser::Error>> SourceTextModule:
|
|||
|
||||
for (auto const& export_entry : export_statement.entries()) {
|
||||
|
||||
// Special case, export {} from "module" should add "module" to
|
||||
// required_modules but not any import or export so skip here.
|
||||
if (export_entry.kind == ExportStatement::ExportEntry::Kind::EmptyNamedExport) {
|
||||
VERIFY(export_statement.entries().size() == 1);
|
||||
break;
|
||||
}
|
||||
|
||||
// a. If ee.[[ModuleRequest]] is null, then
|
||||
if (!export_entry.is_module_request()) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue