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

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

Issue 24730002: Automatically append ".js" on spawnUri if we are running in JavaScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove todo. Created 7 years, 3 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 | « no previous file | tests/isolate/isolate.status » ('j') | tools/testing/dart/test_suite.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a6e620372d45025e6e4497f2f2be1347d6c9a4c..9d1261826107f9590de2702047050c17d51ee7eb 100644
--- a/sdk/lib/_internal/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/lib/isolate_helper.dart
@@ -606,7 +606,13 @@ class IsolateNatives {
// TODO(sigmund): clean up above, after we make the new API the default:
+ /// If [uri] is `null` it is replaced with the current script.
static spawn(String functionName, String uri, bool isLight) {
+ // Assume that the compiled version of the Dart file lives just next to the
+ // dart file.
+ // TODO(floitsch): support precompiled version of dart2js output.
+ if (uri != null && uri.endsWith(".dart")) uri += ".js";
+
Completer<SendPort> completer = new Completer.sync<SendPort>();
ReceivePort port = new ReceivePort();
port.receive((msg, SendPort replyPort) {
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('j') | tools/testing/dart/test_suite.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698