| Index: lib/core/options.dart
|
| diff --git a/lib/core/options.dart b/lib/core/options.dart
|
| index 0685d176f5b0cc8f5486485ed29863f4ac9254c2..3377c30d2eaf56ca0d53cbd6e31c188615ddadc8 100644
|
| --- a/lib/core/options.dart
|
| +++ b/lib/core/options.dart
|
| @@ -13,7 +13,7 @@ abstract class Options {
|
| * A newly constructed Options object contains the arguments exactly as they
|
| * have been passed to the isolate.
|
| */
|
| - factory Options() => new RuntimeOptions();
|
| + factory Options() => new _OptionsImpl();
|
|
|
| /**
|
| * Returns a list of arguments that have been passed to this isolate. Any
|
| @@ -42,3 +42,32 @@ abstract class Options {
|
| */
|
| String get script;
|
| }
|
| +
|
| +class _OptionsImpl implements Options {
|
| + List<String> get arguments {
|
| + if (_arguments === null) {
|
| + // On first access make a copy of the native arguments.
|
| + _arguments = _nativeArguments.getRange(0, _nativeArguments.length);
|
| + }
|
| + return _arguments;
|
| + }
|
| +
|
| + String get executable {
|
| + return _nativeExecutable;
|
| + }
|
| +
|
| + String get script {
|
| + return _nativeScript;
|
| + }
|
| +
|
| + List<String> _arguments = null;
|
| +
|
| + // This arguments singleton is written to by the embedder if applicable.
|
| + static List<String> _nativeArguments = const [];
|
| +
|
| + // This executable singleton is written to by the embedder if applicable.
|
| + static String _nativeExecutable = '';
|
| +
|
| + // This script singleton is written to by the embedder if applicable.
|
| + static String _nativeScript = '';
|
| +}
|
|
|