Chromium Code Reviews| Index: dart/lib/compiler/implementation/lib/js_helper.dart |
| =================================================================== |
| --- dart/lib/compiler/implementation/lib/js_helper.dart (revision 8049) |
| +++ 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 numberOfArguments) { |
|
kasperl
2012/05/29 12:16:24
numberOfArguments -> arity?
ngeoffray
2012/05/29 12:31:01
Done.
|
| 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(), |
| + numberOfArguments); |
| JS('void', @'#.$identity = #', closure, function); |
| return function; |