Chromium Code Reviews| 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 Options object allows accessing the arguments which have been passed to | 8 * The Options object allows accessing the arguments which have been passed to |
| 9 * the current isolate. | 9 * the current isolate. |
| 10 */ | 10 */ |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 */ | 34 */ |
| 35 String get executable; | 35 String get executable; |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Returns the path of the script being run in this isolate. | 38 * Returns the path of the script being run in this isolate. |
| 39 * | 39 * |
| 40 * If the executable environment does not support [script] an empty | 40 * If the executable environment does not support [script] an empty |
| 41 * string is returned. | 41 * string is returned. |
| 42 */ | 42 */ |
| 43 String get script; | 43 String get script; |
| 44 | |
| 45 | |
| 46 /** | |
| 47 * Returns the version of the current dart runtime. | |
| 48 */ | |
| 49 String get version; | |
| 44 } | 50 } |
| 45 | 51 |
| 46 class _OptionsImpl implements Options { | 52 class _OptionsImpl implements Options { |
| 47 List<String> get arguments { | 53 List<String> get arguments { |
| 48 if (_arguments == null) { | 54 if (_arguments == null) { |
| 49 // On first access make a copy of the native arguments. | 55 // On first access make a copy of the native arguments. |
| 50 _arguments = _nativeArguments.sublist(0, _nativeArguments.length); | 56 _arguments = _nativeArguments.sublist(0, _nativeArguments.length); |
| 51 } | 57 } |
| 52 return _arguments; | 58 return _arguments; |
| 53 } | 59 } |
| 54 | 60 |
| 55 String get executable { | 61 String get executable { |
| 56 return _nativeExecutable; | 62 return _nativeExecutable; |
| 57 } | 63 } |
| 58 | 64 |
| 59 String get script { | 65 String get script { |
| 60 return _nativeScript; | 66 return _nativeScript; |
| 61 } | 67 } |
| 62 | 68 |
| 69 String get version; | |
|
Søren Gjesse
2013/06/11 11:02:00
???
Anders Johnsen
2013/06/11 11:37:55
Done.
| |
| 70 // return _nativeVersion; | |
| 71 // } | |
| 72 | |
| 63 List<String> _arguments = null; | 73 List<String> _arguments = null; |
| 64 | 74 |
| 65 // This arguments singleton is written to by the embedder if applicable. | 75 // This arguments singleton is written to by the embedder if applicable. |
| 66 static List<String> _nativeArguments = const []; | 76 static List<String> _nativeArguments = const []; |
| 67 | 77 |
| 68 // This executable singleton is written to by the embedder if applicable. | 78 // This executable singleton is written to by the embedder if applicable. |
| 69 static String _nativeExecutable = ''; | 79 static String _nativeExecutable = ''; |
| 70 | 80 |
| 71 // This script singleton is written to by the embedder if applicable. | 81 // This script singleton is written to by the embedder if applicable. |
| 72 static String _nativeScript = ''; | 82 static String _nativeScript = ''; |
| 83 | |
|
Søren Gjesse
2013/06/11 11:02:00
???
Anders Johnsen
2013/06/11 11:37:55
Done.
| |
| 84 // static String _nativeVersion = ''; | |
| 73 } | 85 } |
| OLD | NEW |