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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9369062: Ensure 'raises' clauses on operations are saved in IDL database. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | client/dom/scripts/fremontcutbuilder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index acff25a3a3adfcb94f860b2b7ed5d5664169e9d6..813443a2a9b620a15fb25b29b0049fd91730fc85 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -449,6 +449,10 @@ class DartGenerator(object):
continue
interfaces.append(interface)
+ # TODO(sra): Use this list of exception names to generate information to
+ # tell Frog which exceptions can be passed from JS to Dart code.
+ exceptions = self._CollectExceptions(interfaces)
+
# Render all interfaces into Dart and save them in files.
for interface in self._PreOrderInterfaces(interfaces):
@@ -630,6 +634,21 @@ class DartGenerator(object):
return result;
+ def _CollectExceptions(self, interfaces):
+ """Returns the names of all exception classes raised."""
+ exceptions = set()
+ for interface in interfaces:
+ for attribute in interface.attributes:
+ if attribute.get_raises:
+ exceptions.add(attribute.get_raises.id)
+ if attribute.set_raises:
+ exceptions.add(attribute.set_raises.id)
+ for operation in interface.operations:
+ if operation.raises:
+ exceptions.add(operation.raises.id)
+ return exceptions
+
+
def Flush(self):
"""Write out all pending files."""
_logger.info('Flush...')
« no previous file with comments | « no previous file | client/dom/scripts/fremontcutbuilder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698