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

Unified Diff: tool/input_sdk/private/isolate_helper.dart

Issue 1200233004: fixes #168, dart:js implementation with a test (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix error (window not defined) Created 5 years, 6 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
« no previous file with comments | « tool/input_sdk/private/foreign_helper.dart ('k') | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/isolate_helper.dart
diff --git a/tool/input_sdk/private/isolate_helper.dart b/tool/input_sdk/private/isolate_helper.dart
index 6511b1f0f1a858f34e1fcdb0e0d566599d76327d..c0d7367acc296a730c307fa714ff9b2505afdb5e 100644
--- a/tool/input_sdk/private/isolate_helper.dart
+++ b/tool/input_sdk/private/isolate_helper.dart
@@ -21,11 +21,9 @@ import 'dart:_js_helper' show
InternalMap,
Null,
Primitives,
- convertDartClosureToJS,
random64;
-import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS,
- JS,
+import 'dart:_foreign_helper' show JS,
JS_CREATE_ISOLATE,
JS_CURRENT_ISOLATE_CONTEXT,
JS_CURRENT_ISOLATE,
@@ -245,7 +243,7 @@ class _Manager {
void _nativeInitWorkerMessageHandler() {
var function = JS('',
"(function (f, a) { return function (e) { f(a, e); }})(#, #)",
- DART_CLOSURE_TO_JS(IsolateNatives._processWorkerMessage),
+ IsolateNatives._processWorkerMessage,
mainManager);
JS("void", r"self.onmessage = #", function);
// We ensure dartPrint is defined so that the implementation of the Dart
@@ -258,7 +256,7 @@ class _Manager {
self.postMessage(serialize(object));
}
}
-})(#)''', DART_CLOSURE_TO_JS(_serializePrintMessage));
+})(#)''', _serializePrintMessage);
}
static _serializePrintMessage(object) {
@@ -1100,7 +1098,7 @@ class IsolateNatives {
return f(e, u, c)
}
})(#, #, #)''',
- DART_CLOSURE_TO_JS(workerOnError), uri, onError);
+ workerOnError, uri, onError);
JS('void', '#.onerror = #', worker, onerrorTrampoline);
var processWorkerMessageTrampoline = JS(
@@ -1114,7 +1112,7 @@ class IsolateNatives {
return f(a, e);
}
})(#, #)""",
- DART_CLOSURE_TO_JS(_processWorkerMessage),
+ _processWorkerMessage,
worker);
JS('void', '#.onmessage = #', worker, processWorkerMessageTrampoline);
var workerId = _globalState.nextManagerId++;
@@ -1367,9 +1365,8 @@ class TimerImpl implements Timer {
enterJsAsync();
- _handle = JS('int', 'self.setTimeout(#, #)',
- convertDartClosureToJS(internalCallback, 0),
- milliseconds);
+ _handle = JS(
+ 'int', 'self.setTimeout(#, #)', internalCallback, milliseconds);
} else {
assert(milliseconds > 0);
throw new UnsupportedError("Timer greater than 0.");
@@ -1381,8 +1378,7 @@ class TimerImpl implements Timer {
if (hasTimer()) {
enterJsAsync();
_handle = JS('int', 'self.setInterval(#, #)',
- convertDartClosureToJS(() { callback(this); }, 0),
- milliseconds);
+ () { callback(this); }, milliseconds);
} else {
throw new UnsupportedError("Periodic timer.");
}
« no previous file with comments | « tool/input_sdk/private/foreign_helper.dart ('k') | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698