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

Unified Diff: lib/html/scripts/generator.py

Issue 11196017: Remove unnecessary support for default values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/generator.py
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index a6e757808783e049b69d1badf321fd5543adcd99..5eec8873d3f9eeb4a8f51e83acc9c1ecdbce1a1e 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -352,7 +352,7 @@ class OperationInfo(object):
if dart_type != 'Dynamic':
dart_type = rename_type(dart_type)
return TypeOrNothing(dart_type, param.type_id)
- return self._FormatParams(self.param_infos, None, type_function)
+ return self._FormatParams(self.param_infos, type_function)
def ParametersImplementationDeclaration(self, rename_type):
"""Returns a formatted string declaring the parameters for the
@@ -368,7 +368,7 @@ class OperationInfo(object):
if dart_type != 'Dynamic':
dart_type = rename_type(dart_type)
return TypeOrNothing(dart_type)
- return self._FormatParams(self.param_infos, 'null', type_function)
+ return self._FormatParams(self.param_infos, type_function)
def ParametersAsArgumentList(self, parameter_count = None):
"""Returns a string of the parameter names suitable for passing the
@@ -380,13 +380,10 @@ class OperationInfo(object):
lambda param_info: param_info.name,
self.param_infos[:parameter_count]))
- def _FormatParams(self, params, default_value, type_fn):
+ def _FormatParams(self, params, type_fn):
def FormatParam(param):
"""Returns a parameter declaration fragment for an ParamInfo."""
- type = type_fn(param)
- if param.is_optional and default_value and default_value != 'null':
- return '%s%s = %s' % (type, param.name, default_value)
- return '%s%s' % (type, param.name)
+ return '%s%s' % (type_fn(param), param.name)
required = []
optional = []
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698