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

Unified Diff: lib/isolate/frog/isolateimpl.dart

Issue 9478027: spawnUri: fixing test with recent support for multi-script tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | lib/isolate/isolate_frog.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/frog/isolateimpl.dart
diff --git a/lib/isolate/frog/isolateimpl.dart b/lib/isolate/frog/isolateimpl.dart
index a990e20421281905f6b84b6e59638d0c719462ac..d0ead3f280378e03ce23836c82d934e85834d8ad 100644
--- a/lib/isolate/frog/isolateimpl.dart
+++ b/lib/isolate/frog/isolateimpl.dart
@@ -336,8 +336,12 @@ class _IsolateNatives {
* The src url for the script tag that loaded this code. Used to create
* JavaScript workers.
*/
- static String get _thisScript() =>
- _thisScriptCache != null ? _thisScriptCache : _computeThisScript();
+ static String get _thisScript() {
+ if (_thisScriptCache == null) {
+ _thisScriptCache = _computeThisScript();
+ }
+ return _thisScriptCache;
+ }
static String _thisScriptCache;
@@ -358,7 +362,6 @@ class _IsolateNatives {
src = "FIXME:5407062" + "_" + Math.random().toString();
if (script) script.src = src;
}
- _IsolateNatives._thisScriptCache = src;
Siggi Cherem (dart-lang) 2012/02/28 02:40:48 this was not working because the code was generate
return src;
""";
@@ -606,6 +609,10 @@ class _IsolateNatives {
// TODO(eub): convert to 'main' once we switch back to port at top-level.
if (functionName == null) functionName = 'isolateMain';
if (uri == null) uri = _thisScript;
+ if (!(new Uri.fromString(uri).isAbsolute())) {
+ String prefix = _thisScript.substring(0, _thisScript.lastIndexOf('/'));
+ uri = "$prefix/$uri";
+ }
final worker = _newWorker(uri);
worker.onmessage = (e) { _processWorkerMessage(worker, e); };
var workerId = globalState.nextWorkerId++;
« no previous file with comments | « no previous file | lib/isolate/isolate_frog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698