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

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: Fix typo. 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') | no next file with comments »
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 4899b4684241a4529600b0623ed2a019c7f22e77..ac4cc0f87211e3792329a71ec6ac285a545d0faa 100644
--- a/sdk/lib/_internal/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/lib/isolate_helper.dart
@@ -595,7 +595,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698