Commit ddcf1ef5 authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

IDLCompiler: Set correct component on Union

A user defined type is defined with a non-partial and non-mixin
definition of an IDL definition.
Following it, this CL defines a Union's component as a set of components
where its member types are defined.


Bug: 839389
Change-Id: I8632364d72cc33680ed30086f42777bb42f0ce43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2026554
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736261}
parent d70da86e
......@@ -72,13 +72,13 @@ class Union(WithIdentifier, WithCodeGeneratorInfo, WithComponent,
components = set()
def collect_components(idl_type):
user_defined_type = idl_type.type_definition_object
if user_defined_type:
components.update(user_defined_type.components)
def collect_primary_component(idl_type):
type_definition_object = idl_type.type_definition_object
if type_definition_object:
components.add(type_definition_object.components[0])
for idl_type in flattened_members:
idl_type.apply_to_all_composing_elements(collect_components)
idl_type.apply_to_all_composing_elements(collect_primary_component)
# TODO(peria, yukishiino): Produce unique union names. Trying to
# produce the names compatible to the old bindings generator for the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment