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

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

Issue 704503002: IDL: Union type support for attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@union-arraybuffer
Patch Set: Created 6 years, 1 month 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/v8_attributes.py
diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py
index 13256457f6c3bbe4ea057131760e55f8c8dc0694..a98e9523e7e9f96834399f322b1751393be41cf8 100644
--- a/Source/bindings/scripts/v8_attributes.py
+++ b/Source/bindings/scripts/v8_attributes.py
@@ -125,6 +125,7 @@ def attribute_context(interface, attribute):
'is_static': attribute.is_static,
'is_url': 'URL' in extended_attributes,
'is_unforgeable': 'Unforgeable' in extended_attributes,
+ 'is_union_type': idl_type.is_union_type,
'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs]
'name': attribute.name,
'only_exposed_to_private_script': is_only_exposed_to_private_script,
@@ -234,6 +235,10 @@ def getter_expression(interface, attribute, context):
arguments.append('isNull')
if context['is_getter_raises_exception']:
arguments.append('exceptionState')
+ # Union type attribute getters take impl class object as the last argument
+ # and set value to it, not returning the value.
+ if attribute.idl_type.is_union_type:
+ arguments.append('result')
return '%s(%s)' % (getter_name, ', '.join(arguments))

Powered by Google App Engine
This is Rietveld 408576698