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

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

Issue 9495014: Support Dart optional arguments which are not dispatched, but instead use default values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename 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/databasebuilder.py
diff --git a/client/dom/scripts/databasebuilder.py b/client/dom/scripts/databasebuilder.py
index 81d104682d64660c57c4a72805cd71b3f7db09d3..f0e2d55ee50c82d58c0694e0ab9e3df5a21be491 100755
--- a/client/dom/scripts/databasebuilder.py
+++ b/client/dom/scripts/databasebuilder.py
@@ -126,13 +126,19 @@ class DatabaseBuilder(object):
for op in interface.operations:
for i in range(0, len(op.arguments)):
argument = op.arguments[i]
+
+ in_optional_whitelist = (interface.id, op.id, argument.id) in optional_argument_whitelist
+ if in_optional_whitelist or set(['Optional', 'Callback']).issubset(argument.ext_attrs.keys()):
+ argument.is_optional = True
+ argument.ext_attrs['RequiredCppParameter'] = None
+ continue
+
if argument.is_optional:
if 'Optional' in argument.ext_attrs:
optional_value = argument.ext_attrs['Optional']
if optional_value:
- if (interface.id, op.id, argument.id) not in optional_argument_whitelist:
- argument.is_optional = False
- del argument.ext_attrs['Optional']
+ argument.is_optional = False
+ del argument.ext_attrs['Optional']
# split operations with optional args into multiple operations
new_ops = []
« 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