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

Unified Diff: dart/lib/compiler/implementation/lib/js_helper.dart

Issue 10441071: Use the typedef arity to know how to invoke a closure given by the dom. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 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
Index: dart/lib/compiler/implementation/lib/js_helper.dart
===================================================================
--- dart/lib/compiler/implementation/lib/js_helper.dart (revision 8060)
+++ dart/lib/compiler/implementation/lib/js_helper.dart (working copy)
@@ -850,17 +850,18 @@
* Called by generated code to convert a Dart closure to a JS
* closure when the Dart closure is passed to the DOM.
*/
-convertDartClosureToJS(closure) {
+convertDartClosureToJS(closure, int arity) {
if (closure === null) return null;
var function = JS('var', @'#.$identity', closure);
if (JS('bool', @'!!#', function)) return function;
function = JS("var", @"""function() {
- return #(#, #, arguments.length, arguments[0], arguments[1]);
+ return #(#, #, #, arguments[0], arguments[1]);
}""",
DART_CLOSURE_TO_JS(invokeClosure),
closure,
- JS_CURRENT_ISOLATE());
+ JS_CURRENT_ISOLATE(),
+ arity);
JS('void', @'#.$identity = #', closure, function);
return function;
« no previous file with comments | « dart/lib/compiler/implementation/elements/elements.dart ('k') | dart/lib/compiler/implementation/native_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698