Chromium Code Reviews| 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++; |