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

Unified Diff: sdk/lib/io/platform_impl.dart

Issue 423843002: Compute absolute script path at isolate startup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « sdk/lib/io/platform.dart ('k') | tests/standalone/io/platform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/platform_impl.dart
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart
index 91bb7a7c3b6c81240f62e21c4354f71aad795d57..1b15320cb0193b411f0cba040aa4c46d4caf27c2 100644
--- a/sdk/lib/io/platform_impl.dart
+++ b/sdk/lib/io/platform_impl.dart
@@ -25,16 +25,16 @@ class _Platform {
static int get numberOfProcessors => _numberOfProcessors();
static String get pathSeparator => _pathSeparator();
static String get operatingSystem => _operatingSystem();
- static Uri script = _script();
- static Uri _script() {
- // The embedder (Dart executable) creates the Platform._nativeScript field.
- var s = Platform._nativeScript;
- if (s.startsWith('http:') ||
- s.startsWith('https:') ||
- s.startsWith('file:')) {
- return Uri.parse(s);
+ static Uri script;
+
+ // This script singleton is written to by the embedder if applicable.
+ static String set _nativeScript(String path) {
+ if (path.startsWith('http:') ||
+ path.startsWith('https:') ||
+ path.startsWith('file:')) {
+ script = Uri.parse(path);
} else {
- return Uri.base.resolveUri(new Uri.file(s));
+ script = Uri.base.resolveUri(new Uri.file(path));
}
}
« no previous file with comments | « sdk/lib/io/platform.dart ('k') | tests/standalone/io/platform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698