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

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

Issue 237583014: JS templates (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cleanup Created 6 years, 8 months 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: sdk/lib/_internal/lib/isolate_helper.dart
diff --git a/sdk/lib/_internal/lib/isolate_helper.dart b/sdk/lib/_internal/lib/isolate_helper.dart
index 9245d07bae5e092ba92b947cac2b4a7c7e35e7bf..85d9f2bd0442e559dfcd67a695fed23a543e3243 100644
--- a/sdk/lib/_internal/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/lib/isolate_helper.dart
@@ -226,9 +226,9 @@ class _Manager {
void _nativeInitWorkerMessageHandler() {
var function = JS('',
- "function (e) { #(#, e); }",
- DART_CLOSURE_TO_JS(IsolateNatives._processWorkerMessage),
- mainManager);
+ "(function (f, a) { return function (e) { f(a, e); }})(#, #)",
floitsch 2014/04/22 16:11:18 I would prefer this in a separate CL.
+ DART_CLOSURE_TO_JS(IsolateNatives._processWorkerMessage),
+ mainManager);
JS("void", r"#.onmessage = #", globalThis, function);
// We define dartPrint so that the implementation of the Dart
// print method knows what to call.
@@ -953,7 +953,7 @@ class IsolateNatives {
final worker = JS('var', 'new Worker(#)', uri);
var processWorkerMessageTrampoline =
- JS('', 'function(e) { #(#, e); }',
+ JS('', "(function (f, a) { return function (e) { f(a, e); }})(#, #)",
floitsch 2014/04/22 16:11:18 ditto.
DART_CLOSURE_TO_JS(_processWorkerMessage),
worker);
JS('void', '#.onmessage = #', worker, processWorkerMessageTrampoline);

Powered by Google App Engine
This is Rietveld 408576698