Commit d05828f5 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bind-gen: Fix union's component

Makes union's component "core" if the union is used in "core".

Bug: 839389
Change-Id: Ic097aec9eb8c7dd6c176714421f7a61bbe0c7de6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2056524
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741429}
parent 53f24266
......@@ -82,11 +82,17 @@ class Union(WithIdentifier, WithCodeGeneratorInfo, WithComponent,
# Make this union type look defined in 'modules' if the union type is
# used in 'modules' in order to keep the backward compatibility with
# the old bindings generator.
is_defined_in_core = False
is_defined_in_modules = False
for idl_type in union_types:
filepath = idl_type.debug_info.location.filepath
if filepath.startswith('third_party/blink/renderer/core/'):
is_defined_in_core = True
if filepath.startswith('third_party/blink/renderer/modules/'):
from .composition_parts import Component
components.add(Component('modules'))
is_defined_in_modules = True
if not is_defined_in_core and is_defined_in_modules:
from .composition_parts import Component
components.add(Component('modules'))
# 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