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

Unified Diff: dart/sdk/lib/_internal/lib/isolate_helper.dart

Issue 27524003: Generate tear-off closures dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r30954 Created 7 years 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/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 5c88c49aaf6868deb63a46823cf06b258afbcadb..283169cb2107312fdea5d089a20bc4bf9bfc96ff 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;
@@ -563,7 +564,7 @@ class IsolateNatives {
}
static _getJSFunctionFromName(String functionName) {
- return JS("", "init.globalFunctions[#]", functionName);
+ return JS("", "init.globalFunctions[#]()", functionName);
}
/**
@@ -572,7 +573,7 @@ class IsolateNatives {
* but you should probably not count on this.
*/
static String _getJSFunctionName(Function f) {
- return JS("String|Null", r"(#['$name'] || #)", f, null);
+ return (f is Closure) ? JS("String|Null", r'#.$name', f) : null;
}
/** Create a new JavaScript object instance given its constructor. */

Powered by Google App Engine
This is Rietveld 408576698