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

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

Issue 841973002: IDL: Support iterable<>, maplike<> and setlike<> syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « Source/bindings/scripts/idl_definitions.py ('k') | Source/bindings/tests/idls/core/TestInterface2.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 9f8af448e2735aa66c014571277987fecf6405d6..45321e9c32bd0ad39b9dfa317c27929e01ed34d2 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -124,13 +124,15 @@ def interface_context(interface):
# [DependentLifetime]
is_dependent_lifetime = 'DependentLifetime' in extended_attributes
- # [Iterable]
+ # [Iterable], iterable<>, maplike<> and setlike<>
iterator_method = None
# FIXME: support Iterable in partial interfaces. However, we don't
# need to support iterator overloads between interface and
# partial interface definitions.
# http://heycam.github.io/webidl/#idl-overloading
- if 'Iterable' in extended_attributes and not interface.is_partial:
+ if (not interface.is_partial
+ and (interface.iterable or interface.maplike or interface.setlike
+ or 'Iterable' in extended_attributes)):
iterator_operation = IdlOperation(interface.idl_name)
iterator_operation.name = 'iterator'
iterator_operation.idl_type = IdlType('Iterator')
@@ -138,6 +140,9 @@ def interface_context(interface):
iterator_operation.extended_attributes['CallWith'] = 'ScriptState'
iterator_method = v8_methods.method_context(interface,
iterator_operation)
+ # FIXME: iterable<>, maplike<> and setlike<> should also imply the
+ # presence of a subset of keys(), values(), entries(), forEach(), has(),
+ # get(), add(), set(), delete() and clear(), and a 'size' attribute.
# [MeasureAs]
is_measure_as = 'MeasureAs' in extended_attributes
« no previous file with comments | « Source/bindings/scripts/idl_definitions.py ('k') | Source/bindings/tests/idls/core/TestInterface2.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698