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 * The [Platform] class exposes details of the machine and operating | 8 * The [Platform] class exposes details of the machine and operating |
9 * system. | 9 * system. |
10 */ | 10 */ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 /** | 73 /** |
74 * Returns the path of the executable used to run the script in this | 74 * Returns the path of the executable used to run the script in this |
75 * isolate. | 75 * isolate. |
76 * | 76 * |
77 * If the execution environment does not support [executable] an empty | 77 * If the execution environment does not support [executable] an empty |
78 * string is returned. | 78 * string is returned. |
79 */ | 79 */ |
80 static String get executable => _Platform.executable; | 80 static String get executable => _Platform.executable; |
81 | 81 |
82 /** | 82 /** |
83 * Returns the absolute URI of the script being run in this | 83 * Returns the URI of the script being run in this |
84 * isolate. If the script argument on the command line is relative, | 84 * isolate. If the URI is relative it is relative to the file URI of |
85 * it is resolved to an absolute URI before fetching the script, and | 85 * the working directory of the VM when it was started. |
86 * this absolute URI is returned. | |
87 * | |
88 * This implies that a path including "link/.." in the script name | |
89 * is resolved by dropping the link component, which may be different | |
90 * from the file system's path resolution behavior. | |
91 * | 86 * |
92 * If the executable environment does not support [script] an empty | 87 * If the executable environment does not support [script] an empty |
93 * URI is returned. | 88 * URI is returned. |
94 */ | 89 */ |
95 static Uri get script => _Platform.script; | 90 static Uri get script => _Platform.script; |
96 | 91 |
97 /** | 92 /** |
98 * Returns the flags passed to the executable used to run the script in this | 93 * Returns the flags passed to the executable used to run the script in this |
99 * isolate. These are the command-line flags between the executable name | 94 * isolate. These are the command-line flags between the executable name |
100 * and the script name. Each fetch of executableArguments returns a new | 95 * and the script name. Each fetch of executableArguments returns a new |
101 * List, containing the flags passed to the executable. | 96 * List, containing the flags passed to the executable. |
102 */ | 97 */ |
103 static List<String> get executableArguments => _Platform.executableArguments; | 98 static List<String> get executableArguments => _Platform.executableArguments; |
104 | 99 |
105 /** | 100 /** |
106 * Returns the value of the --package-root flag passed to the executable | 101 * Returns the value of the --package-root flag passed to the executable |
107 * used to run the script in this isolate. This is the directory in which | 102 * used to run the script in this isolate. This is the directory in which |
108 * Dart packages are looked up. | 103 * Dart packages are looked up. |
109 * | 104 * |
110 * If there is no --package-root flag, then the empty string is returned. | 105 * If there is no --package-root flag, then the empty string is returned. |
111 */ | 106 */ |
112 static String get packageRoot => _Platform.packageRoot; | 107 static String get packageRoot => _Platform.packageRoot; |
113 | 108 |
114 /** | 109 /** |
115 * Returns the version of the current Dart runtime. | 110 * Returns the version of the current Dart runtime. |
116 */ | 111 */ |
117 static String get version => _version; | 112 static String get version => _version; |
118 } | 113 } |
OLD | NEW |