Index: dart/sdk/lib/_internal/lib/isolate_helper.dart |
diff --git a/dart/sdk/lib/_internal/lib/isolate_helper.dart b/dart/sdk/lib/_internal/lib/isolate_helper.dart |
index 474d6af8c7727dbf0db6163a2e22add8ddec6601..1da84ba4f48f6fb23f0e42313965ff00e3576136 100644 |
--- a/dart/sdk/lib/_internal/lib/isolate_helper.dart |
+++ b/dart/sdk/lib/_internal/lib/isolate_helper.dart |
@@ -8,6 +8,7 @@ import 'dart:async'; |
import 'dart:collection' show Queue, HashMap; |
import 'dart:isolate'; |
import 'dart:_js_helper' show |
+ Closure, |
Null, |
Primitives, |
convertDartClosureToJS; |
@@ -548,7 +549,7 @@ class IsolateNatives { |
} |
static _getJSFunctionFromName(String functionName) { |
- return JS("", "init.globalFunctions[#]", functionName); |
+ return JS("", "init.globalFunctions[#]()", functionName); |
} |
/** |
@@ -557,7 +558,8 @@ class IsolateNatives { |
* but you should probably not count on this. |
*/ |
static String _getJSFunctionName(Function f) { |
- return JS("String|Null", r"(#['$name'] || #)", f, null); |
+ if (f is! Closure) return null; |
+ return JS("String|Null", r'#.$name', f); |
} |
/** Create a new JavaScript object instance given its constructor. */ |