Index: sdk/lib/io/platform_impl.dart |
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart |
index 56a586916d04af66c7179bebb6b0398bb6882291..3e018a0e7b669bffa3d8a77869c79361f30ab12c 100644 |
--- a/sdk/lib/io/platform_impl.dart |
+++ b/sdk/lib/io/platform_impl.dart |
@@ -18,6 +18,18 @@ 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); |
+ } else { |
+ return new Uri.file(s); |
+ } |
+ } |
static String get localHostname { |
var result = _localHostname(); |