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

Unified Diff: tools/dom/scripts/generator.py

Issue 12052076: Support overloaded constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 4c7115c14831c532f6c8ebb113c29427b52de5b9..4ea4220cf28e441f5c10cbda3df377cbe1d8e129 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -222,20 +222,15 @@ def AnalyzeConstructor(interface):
"""
if 'Constructor' in interface.ext_attrs:
name = None
- func_value = interface.ext_attrs.get('Constructor')
- if not func_value:
- args = []
- idl_args = []
+ overloads = interface.ext_attrs['Constructor']
+ idl_args = [[] if f is None else f.arguments for f in overloads]
elif 'NamedConstructor' in interface.ext_attrs:
func_value = interface.ext_attrs.get('NamedConstructor')
+ idl_args = [func_value.arguments]
name = func_value.id
else:
return None
- if func_value:
- idl_args = func_value.arguments
- args =_BuildArguments([idl_args], interface, True)
-
info = OperationInfo()
info.overloads = None
info.idl_args = idl_args
@@ -244,7 +239,7 @@ def AnalyzeConstructor(interface):
info.constructor_name = None
info.js_name = name
info.type_name = interface.id
- info.param_infos = args
+ info.param_infos = _BuildArguments(idl_args, interface, constructor=True)
info.requires_named_arguments = False
info.pure_dart_constructor = False
return info
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698