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

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

Issue 14761002: Preserve nullability when writing idl with the ildrenderer. Use nullability to call the toNativeWit… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/idlrenderer.py
diff --git a/tools/dom/scripts/idlrenderer.py b/tools/dom/scripts/idlrenderer.py
index 7c5d6340adc70050fc0738d43b995f4af9c58754..3c71ff81dd53281bc213e4aecef6dab7fc057826 100755
--- a/tools/dom/scripts/idlrenderer.py
+++ b/tools/dom/scripts/idlrenderer.py
@@ -179,7 +179,10 @@ def render(idl_node, indent_str=' '):
wsp(node.ext_attrs)
if (node.optional):
w('optional ')
- w('%s %s' % (node.type.id, node.id))
+ w(node.type.id)
+ if node.type.nullable:
+ w('?')
+ w(' %s' % node.id)
else:
raise TypeError("Expected str or IDLNode but %s found" %
type(node))
« no previous file with comments | « no previous file | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698