| Index: runtime/bin/platform_impl.dart
|
| diff --git a/runtime/bin/platform_impl.dart b/runtime/bin/platform_impl.dart
|
| index f859854e89cdeca9e3b20a6841ce45b30197b8ad..46f041370ee0ef805a63b622c6f300ffd2981a7f 100644
|
| --- a/runtime/bin/platform_impl.dart
|
| +++ b/runtime/bin/platform_impl.dart
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| @@ -9,6 +9,7 @@ class _Platform implements Platform {
|
| static String _pathSeparator() native "Platform_PathSeparator";
|
| static String _operatingSystem() native "Platform_OperatingSystem";
|
| static _localHostname() native "Platform_LocalHostname";
|
| + static _environment() native "Platform_Environment";
|
|
|
| int numberOfProcessors() {
|
| return _numberOfProcessors();
|
| @@ -30,4 +31,19 @@ class _Platform implements Platform {
|
| return result;
|
| }
|
| }
|
| +
|
| + Map<String, String> environment() {
|
| + var env = _environment();
|
| + if (env is OSError) {
|
| + throw env;
|
| + } else {
|
| + var result = new Map();
|
| + for (var str in env) {
|
| + var equalsIndex = str.indexOf('=');
|
| + assert(equalsIndex != -1);
|
| + result[str.substring(0, equalsIndex)] = str.substring(equalsIndex + 1);
|
| + }
|
| + return result;
|
| + }
|
| + }
|
| }
|
|
|