1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:18:12 +00:00

LibIDL+LibWeb: Begin supporting the LegacyNamespace extended attribute

This is used by WebAssembly IDL files. For now, we mostly use this for
error messages and cache keys (to ensure compatibility with existing
code as WebAssembly is ported to IDL).
This commit is contained in:
Timothy Flynn 2023-03-15 14:40:51 -04:00 committed by Andreas Kling
parent 1ff75618c0
commit af119d92cb
4 changed files with 16 additions and 8 deletions

View file

@ -592,6 +592,11 @@ void Parser::parse_interface(Interface& interface)
parse_function(extended_attributes, interface);
}
if (auto legacy_namespace = interface.extended_attributes.get("LegacyNamespace"sv); legacy_namespace.has_value())
interface.namespaced_name = DeprecatedString::formatted("{}.{}", *legacy_namespace, interface.name);
else
interface.namespaced_name = interface.name;
interface.constructor_class = DeprecatedString::formatted("{}Constructor", interface.name);
interface.prototype_class = DeprecatedString::formatted("{}Prototype", interface.name);
interface.prototype_base_class = DeprecatedString::formatted("{}Prototype", interface.parent_name.is_empty() ? "Object" : interface.parent_name);