Index: frog/leg/lib/js_helper.dart |
=================================================================== |
--- frog/leg/lib/js_helper.dart (revision 5170) |
+++ frog/leg/lib/js_helper.dart (working copy) |
@@ -1333,7 +1333,10 @@ |
* closure when the Dart closure is passed to the DOM. |
*/ |
convertDartClosureToJS(closure) { |
- return JS("var", @"""function() { |
+ if (JS('bool', @'"$identity" in $0', closure)) { |
kasperl
2012/03/08 15:06:08
The 'in' construct is probably not going to perfor
ngeoffray
2012/03/08 15:11:36
OK, I copied the test from line 1276, I'll change
ngeoffray
2012/03/08 15:24:01
There is actually a good reason why the code line
|
+ return JS('var', @'$0.$identity', closure); |
+ } |
+ var function = JS("var", @"""function() { |
var dartClosure = $0; |
switch (arguments.length) { |
case 0: return $1(dartClosure); |
@@ -1347,6 +1350,8 @@ |
callClosure0, |
callClosure1, |
callClosure2); |
+ JS('void', @'$0.$identity = $1', closure, function); |
+ return function; |
} |
/** |