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

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

Issue 483163003: Introduce ES6 iterator for DOM objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 1b061eb908170608b139bd5e5fa7a1c151cc3e6c..b3399e46e2094de428b6d31ea980de528b9dc505 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -101,6 +101,19 @@ def interface_context(interface):
# [DependentLifetime]
is_dependent_lifetime = 'DependentLifetime' in extended_attributes
+ # [Iterable]
+ is_iterable = 'Iterable' in extended_attributes
+ iterator_method = None
+ if is_iterable:
+ includes.add('bindings/core/v8/V8Iterator.h')
Jens Widell 2014/08/21 13:58:01 Is this needed? I thought it was at first, but the
yhirano 2014/08/25 06:09:26 You're right, thanks!
+ iterator_operation = IdlOperation(interface.idl_name)
+ iterator_operation.name = 'iterator'
+ iterator_operation.idl_type = IdlType('Iterator')
+ iterator_operation.extended_attributes['RaisesException'] = None
+ iterator_operation.extended_attributes['CallWith'] = 'ScriptState'
+ iterator_method = v8_methods.method_context(interface,
+ iterator_operation)
+
# [MeasureAs]
is_measure_as = 'MeasureAs' in extended_attributes
if is_measure_as:
@@ -159,7 +172,9 @@ def interface_context(interface):
'is_document': is_document,
'is_event_target': inherits_interface(interface.name, 'EventTarget'),
'is_exception': interface.is_exception,
+ 'is_iterable': is_iterable,
Jens Widell 2014/08/21 13:58:02 I'd slightly prefer if we dropped this and just us
yhirano 2014/08/25 06:09:26 Done.
'is_node': inherits_interface(interface.name, 'Node'),
+ 'iterator_method': iterator_method,
'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
'parent_interface': parent_interface,
'pass_cpp_type': cpp_template_type(

Powered by Google App Engine
This is Rietveld 408576698