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

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

Issue 792903004: IDL: Support extended attributes on iterable<>, maplike<> and setlike<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments 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/templates/interface_base.cpp » ('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 d5a49707b12e2107cba326df22c406938821575b..b5f4103a1a8287470c7bffcb764f61b8c58ee489 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -342,11 +342,30 @@ def interface_context(interface):
and (interface.iterable or interface.maplike or interface.setlike
or 'Iterable' in extended_attributes)):
+ used_extended_attributes = {}
+
+ if interface.iterable:
+ used_extended_attributes.update(interface.iterable.extended_attributes)
+ elif interface.maplike:
+ used_extended_attributes.update(interface.maplike.extended_attributes)
+ elif interface.setlike:
+ used_extended_attributes.update(interface.setlike.extended_attributes)
+
+ if 'RaisesException' in used_extended_attributes:
+ raise ValueError('[RaisesException] is implied for iterable<>/maplike<>/setlike<>')
+ if 'CallWith' in used_extended_attributes:
+ raise ValueError('[CallWith=ScriptState] is implied for iterable<>/maplike<>/setlike<>')
+
+ used_extended_attributes.update({
+ 'RaisesException': None,
+ 'CallWith': 'ScriptState',
+ })
+
def generated_iterator_method(name):
return generated_method(
return_type=IdlType('Iterator'),
name=name,
- extended_attributes={'RaisesException': None, 'CallWith': 'ScriptState'})
+ extended_attributes=used_extended_attributes)
iterator_method = generated_iterator_method('iterator')
« no previous file with comments | « Source/bindings/scripts/idl_definitions.py ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698