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

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
Index: tools/dom/scripts/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index d6bfb7e96cb43bc4703620357213417da646bca9..9d3fc7dfb28a01a9d6ab7ec146c87634967898b1 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -215,20 +215,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
@@ -237,7 +232,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

Powered by Google App Engine
This is Rietveld 408576698