| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Information about the environment in which the current program is running. | 8 * Information about the environment in which the current program is running. |
| 9 * | 9 * |
| 10 * Platform provides information such as the operating system, | 10 * Platform provides information such as the operating system, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * Returns the flags passed to the executable used to run the script in this | 171 * Returns the flags passed to the executable used to run the script in this |
| 172 * isolate. These are the command-line flags between the executable name | 172 * isolate. These are the command-line flags between the executable name |
| 173 * and the script name. Each fetch of executableArguments returns a new | 173 * and the script name. Each fetch of executableArguments returns a new |
| 174 * List, containing the flags passed to the executable. | 174 * List, containing the flags passed to the executable. |
| 175 */ | 175 */ |
| 176 static List<String> get executableArguments => _Platform.executableArguments; | 176 static List<String> get executableArguments => _Platform.executableArguments; |
| 177 | 177 |
| 178 /** | 178 /** |
| 179 * Returns the value of the --package-root flag passed to the executable | 179 * Returns the package root of the current isolate, if any. |
| 180 * used to run the script in this isolate. This is the directory in which | |
| 181 * Dart packages are looked up. | |
| 182 * | 180 * |
| 183 * If there is no --package-root flag, then the empty string is returned. | 181 * If the isolate is using a [packageMap], this getter returns `null`, |
| 182 * otherwise it returns the package root - a directory that package |
| 183 * URIs are resolved against. |
| 184 */ | 184 */ |
| 185 static String get packageRoot => _Platform.packageRoot; | 185 static Future<Uri> get packageRoot => _Platform.packageRoot; |
| 186 |
| 187 /** |
| 188 * Returns the package mapping of the current isolate, if any. |
| 189 * |
| 190 * If the current isolate is using [packageRoot], this getter returns `null`. |
| 191 * |
| 192 * The package map maps the name of a package that is available to the |
| 193 * program, to a URI that package URIs for that package are resolved against. |
| 194 * |
| 195 * Returns an empty map if the isolate does not have a way to resolve package |
| 196 * URIs. |
| 197 */ |
| 198 static Future<Map<String, Uri>> get packageMap => _Platform.packageMap; |
| 186 | 199 |
| 187 /** | 200 /** |
| 188 * Returns the version of the current Dart runtime. | 201 * Returns the version of the current Dart runtime. |
| 189 * | 202 * |
| 190 * The returned `String` is formatted as the | 203 * The returned `String` is formatted as the |
| 191 * [semver](http://semver.org) version string of the current dart | 204 * [semver](http://semver.org) version string of the current dart |
| 192 * runtime, possibly followed by whitespace and other version and | 205 * runtime, possibly followed by whitespace and other version and |
| 193 * build details. | 206 * build details. |
| 194 */ | 207 */ |
| 195 static String get version => _version; | 208 static String get version => _version; |
| 196 } | 209 } |
| OLD | NEW |