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

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

Issue 1349293006: Start using the dart2js type conversions in Dartium as well. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 5 years, 3 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 | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | 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/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 8c12e2e6f7781ce08151d860b9621b837c62bbc7..fe4e03ebe4f265268692475959a75ff022b03528 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -521,7 +521,7 @@ class OperationInfo(object):
else:
return False
- def ParametersAsListOfVariables(self, parameter_count=None, type_registry=None, dart_js_interop=False):
+ def ParametersAsListOfVariables(self, parameter_count=None, type_registry=None, dart_js_interop=False, backend = None):
"""Returns a list of the first parameter_count parameter names
as raw variables.
"""
@@ -588,10 +588,11 @@ class OperationInfo(object):
parameters.append('unwrap_jso(%s)' % p.name)
else:
if dart_js_interop:
+ conversion = backend._InputConversion(p.type_id, self.declared_name)
passParam = p.name
- if type_id == 'Dictionary':
+ if conversion:
# Need to pass the IDL Dictionary from Dart Map to JavaScript object.
- passParam = '{0} != null ? new js.JsObject.jsify({0}) : {0}'.format(p.name)
+ passParam = '{0}({1})'.format(conversion.function_name, p.name)
else:
passParam = p.name
parameters.append(passParam)
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698