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

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: forgotten : 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') | client/dom/scripts/systemwrapping.py » ('J')
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..4fd58d19cb8702f276184bf0eb71aea0155f63cb 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['DartConvertNullToDefaultValue'] = None
podivilov 2012/02/28 17:46:24 DartConvertNullToDefaultValue name doesn't reflect
antonm 2012/02/28 19:22:08 I am on the fence here. To some extent this descr
sra1 2012/02/28 22:04:42 What is confusing to me is that 'null' and 'defaul
antonm 2012/02/29 10:29:40 This shouldn't be Dartium specific and should appl
+ continue
podivilov 2012/02/28 17:46:24 nit: elif
antonm 2012/02/28 19:22:08 I'd prefer continue as it clearly says processing
sra1 2012/02/28 22:04:42 +1 for 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') | client/dom/scripts/systemwrapping.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698