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

Unified Diff: lib/dom/scripts/systembase.py

Issue 10704100: Do not split attributes on getters and setters in databasebuilder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 5 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 | « lib/dom/scripts/idlrenderer.py ('k') | lib/dom/scripts/systemfrog.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/systembase.py
diff --git a/lib/dom/scripts/systembase.py b/lib/dom/scripts/systembase.py
index 89da1a54de981b7d84524d3d51a4995ec269ea84..f394e584e8018116bf04c0634fcac15eea835708 100644
--- a/lib/dom/scripts/systembase.py
+++ b/lib/dom/scripts/systembase.py
@@ -116,10 +116,9 @@ class BaseGenerator(object):
for const in sorted(interface.constants, ConstantOutputOrder):
self.AddConstant(const)
- attributes = [attr for attr in interface.attributes
- if attr.type.id != 'EventListener']
- for (getter, setter) in _PairUpAttributes(attributes):
- self.AddAttribute(getter, setter)
+ for attr in interface.attributes:
+ if attr.type.id != 'EventListener':
+ self.AddAttribute(attr)
# The implementation should define an indexer if the interface directly
# extends List.
@@ -155,10 +154,9 @@ class BaseGenerator(object):
for parent_interface in secondary_parents:
if isinstance(parent_interface, str): # IsDartCollectionType(parent_interface)
continue
- attributes = [attr for attr in parent_interface.attributes
- if not FindMatchingAttribute(interface, attr)]
- for (getter, setter) in _PairUpAttributes(attributes):
- self.AddSecondaryAttribute(parent_interface, getter, setter)
+ for attr in parent_interface.attributes:
+ if not FindMatchingAttribute(interface, attr):
+ self.AddSecondaryAttribute(parent_interface, attr)
# Group overloaded operations by id
operationsById = {}
@@ -177,7 +175,7 @@ class BaseGenerator(object):
def AddConstant(self, constant):
pass
- def AddAttribute(self, getter, setter):
+ def AddAttribute(self, attribute):
pass
def AddIndexer(self, element_type):
@@ -192,10 +190,10 @@ class BaseGenerator(object):
def AddStaticOperation(self, info):
pass
- def AddSecondaryAttribute(self, interface, getter, setter):
+ def AddSecondaryAttribute(self, interface, attribute):
pass
- def AddSecondaryOperation(self, interface, attr):
+ def AddSecondaryOperation(self, interface, info):
pass
def _TransitiveSecondaryParents(self, interface):
@@ -224,17 +222,5 @@ class BaseGenerator(object):
return result
-def _PairUpAttributes(attributes):
- """Returns a list of (getter, setter) pairs sorted by name.
-
- One element of the pair may be None.
- """
- names = sorted(set(attr.id for attr in attributes))
- getters = {}
- setters = {}
- for attr in attributes:
- if attr.is_fc_getter:
- getters[attr.id] = attr
- elif attr.is_fc_setter and 'Replaceable' not in attr.ext_attrs:
- setters[attr.id] = attr
- return [(getters.get(id), setters.get(id)) for id in names]
+def IsReadOnly(attribute):
+ return attribute.is_read_only or 'Replaceable' in attribute.ext_attrs
« no previous file with comments | « lib/dom/scripts/idlrenderer.py ('k') | lib/dom/scripts/systemfrog.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698