1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:37:34 +00:00

LibJS: Allow exporting any imported bindings

This commit is contained in:
davidot 2022-09-01 23:13:45 +02:00 committed by Linus Groh
parent 462c6df24b
commit faf1430ce4
3 changed files with 19 additions and 1 deletions

View file

@ -565,8 +565,15 @@ void Parser::parse_module(Program& program)
if (name == exported_name)
found = true;
});
for (auto& import : program.imports()) {
if (import.has_bound_name(exported_name)) {
found = true;
break;
}
}
if (!found)
syntax_error(String::formatted("'{}' is not declared", exported_name));
syntax_error(String::formatted("'{}' in export is not declared", exported_name), export_statement.source_range().start);
}
}
}