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

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: Created 7 years, 1 month 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 d13871bc6eba2ea3b3cd4160368d5b9b482b53e0..7aa581a333e04bbb94c0ced6b58a9f43f0df32b8 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;
kasperl 2013/11/29 10:10:55 ?:
ahe 2013/12/06 15:57:53 Done.
+ return JS("String|Null", r'#.$name', f);
}
/** Create a new JavaScript object instance given its constructor. */

Powered by Google App Engine
This is Rietveld 408576698