Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: Source/bindings/scripts/compute_interfaces_info_individual.py

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/compute_interfaces_info_individual.py
diff --git a/Source/bindings/scripts/compute_interfaces_info_individual.py b/Source/bindings/scripts/compute_interfaces_info_individual.py
index eb5a2363475486795225f10ce39ec9eb9620414c..8de510438158f4ba856622428496f3ec10fdd1b8 100755
--- a/Source/bindings/scripts/compute_interfaces_info_individual.py
+++ b/Source/bindings/scripts/compute_interfaces_info_individual.py
@@ -197,8 +197,8 @@ class InterfaceInfoCollector(object):
else:
raise Exception('IDL file must contain one interface or dictionary')
- self.union_types.update(
- collect_union_types_from_definitions(definitions))
+ this_union_types = collect_union_types_from_definitions(definitions)
+ self.union_types.update(this_union_types)
extended_attributes = definition.extended_attributes
implemented_as = extended_attributes.get('ImplementedAs')
@@ -220,6 +220,7 @@ class InterfaceInfoCollector(object):
interface_info.update({
'extended_attributes': extended_attributes,
'full_path': full_path,
+ 'has_union_types': len(this_union_types) > 0, # explicit len(...) > 0 to convert boolean
Jens Widell 2014/10/28 11:31:37 Another way of explicitly converting to bool would
bashi 2014/10/29 01:34:32 Definitely better way:) Done.
'implemented_as': implemented_as,
'implemented_by_interfaces': left_interfaces,
'implements_interfaces': right_interfaces,

Powered by Google App Engine
This is Rietveld 408576698