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

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

Issue 9428050: Automatically generate most constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add test 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 | « client/dom/scripts/systemfrog.py ('k') | client/dom/src/dummy_FactoryProviders.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/systeminterface.py
diff --git a/client/dom/scripts/systeminterface.py b/client/dom/scripts/systeminterface.py
index e09d46baf631197bea0b8e0169c7b1b2d4813e1e..fb798f688e2ea35c1e39045b8c887d4ac962fae4 100644
--- a/client/dom/scripts/systeminterface.py
+++ b/client/dom/scripts/systeminterface.py
@@ -115,8 +115,16 @@ class DartInterfaceGenerator(object):
if suppressed_extends:
extends_str += ' /*%s %s */' % (comment, ', '.join(suppressed_extends))
+ factory_provider = None
+ constructor_info = AnalyzeConstructor(self._interface)
+ if constructor_info:
+ factory_provider = '_' + typename + 'FactoryProvider';
+
if typename in interface_factories:
- extends_str += ' default ' + interface_factories[typename]
+ factory_provider = interface_factories[typename]
+
+ if factory_provider:
+ extends_str += ' default ' + factory_provider
# TODO(vsm): Add appropriate package / namespace syntax.
(self._members_emitter,
@@ -125,6 +133,13 @@ class DartInterfaceGenerator(object):
ID=typename,
EXTENDS=extends_str)
+ if constructor_info:
+ self._members_emitter.Emit(
+ '\n'
+ ' $CTOR($PARAMS);\n',
+ CTOR=typename,
+ PARAMS=constructor_info.ParametersInterfaceDeclaration());
+
element_type = MaybeTypedArrayElementType(self._interface)
if element_type:
self._members_emitter.Emit(
« no previous file with comments | « client/dom/scripts/systemfrog.py ('k') | client/dom/src/dummy_FactoryProviders.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698