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

Unified Diff: third_party/WebKit/Source/bindings/scripts/idl_definitions.py

Issue 1381413003: [bindings] add support for integer-indexed @@iterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use SetIntrinsicDataProperty() in new V8 roll Created 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/scripts/idl_definitions.py
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
index 6f67f8ebe0d0bd42eda01ea9b0af6f5f395e8491..16a8290937fe417cfb87a99c409a7a8c461a5330 100644
--- a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
+++ b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
@@ -286,6 +286,7 @@ class IdlInterface(object):
self.serializer = None
self.stringifier = None
self.iterable = None
+ self.has_indexed_elements = False
self.maplike = None
self.setlike = None
self.original_interface = None
@@ -301,11 +302,17 @@ class IdlInterface(object):
self.name = node.GetName()
self.idl_type = IdlType(self.name)
+ has_indexed_property_getter = False
+ has_integer_typed_length = False
+
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
if child_class == 'Attribute':
- self.attributes.append(IdlAttribute(idl_name, child))
+ attr = IdlAttribute(idl_name, child)
+ if attr.idl_type.is_integer_type and attr.name == 'length':
+ has_integer_typed_length = True
+ self.attributes.append(attr)
elif child_class == 'Const':
self.constants.append(IdlConstant(idl_name, child))
elif child_class == 'ExtAttributes':
@@ -315,7 +322,10 @@ class IdlInterface(object):
clear_constructor_attributes(extended_attributes)
self.extended_attributes = extended_attributes
elif child_class == 'Operation':
- self.operations.append(IdlOperation(idl_name, child))
+ op = IdlOperation(idl_name, child)
+ if 'getter' in op.specials and str(op.arguments[0].idl_type) == 'unsigned long':
+ has_indexed_property_getter = True
+ self.operations.append(op)
elif child_class == 'Inherit':
self.parent = child.GetName()
elif child_class == 'Serializer':
@@ -336,6 +346,9 @@ class IdlInterface(object):
if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1:
raise ValueError('Interface can only have one of iterable<>, maplike<> and setlike<>.')
+ if has_integer_typed_length and has_indexed_property_getter:
+ self.has_indexed_elements = True
+
def accept(self, visitor):
visitor.visit_interface(self)
for attribute in self.attributes:
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698