CodeGenerators: Add support for LegacyNoInterfaceObject IDL attribute

When applied, corresponding interface object will not be exposed on the
global object, e.g. for the following IDL:
```
Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface ANGLE_instanced_arrays {
};
```

executing `"ANGLE_instanced_arrays" in window` will return `false`.
This commit is contained in:
Aliaksandr Kalenik 2024-12-20 11:10:54 +01:00 committed by Alexander Kalenik
commit 99b49a5978
Notes: github-actions[bot] 2024-12-20 14:32:58 +00:00

View file

@ -309,6 +309,9 @@ void add_@global_object_snake_name@_exposed_interfaces(JS::Object& global)
if (interface.is_namespace) {
add_namespace(gen, interface.name, interface.namespace_class);
} else if (!interface.extended_attributes.contains("LegacyNamespace"sv)) {
if (interface.extended_attributes.contains("LegacyNoInterfaceObject")) {
continue;
}
if (class_name == "Window") {
add_interface(gen, interface.namespaced_name, interface.prototype_class, lookup_legacy_constructor(interface), interface.extended_attributes.get("LegacyWindowAlias"sv));
} else {