| 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 class _Platform { | 7 class _Platform { |
| 8 external static int _numberOfProcessors(); | 8 external static int _numberOfProcessors(); |
| 9 external static String _pathSeparator(); | 9 external static String _pathSeparator(); |
| 10 external static String _operatingSystem(); | 10 external static String _operatingSystem(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // handle these correctly we search for a second occurrence of | 64 // handle these correctly we search for a second occurrence of |
| 65 // of '=' in the string if the first occurrence is at index 0. | 65 // of '=' in the string if the first occurrence is at index 0. |
| 66 var equalsIndex = str.indexOf('='); | 66 var equalsIndex = str.indexOf('='); |
| 67 if (equalsIndex == 0) { | 67 if (equalsIndex == 0) { |
| 68 equalsIndex = str.indexOf('=', 1); | 68 equalsIndex = str.indexOf('=', 1); |
| 69 } | 69 } |
| 70 assert(equalsIndex != -1); | 70 assert(equalsIndex != -1); |
| 71 result[str.substring(0, equalsIndex)] = | 71 result[str.substring(0, equalsIndex)] = |
| 72 str.substring(equalsIndex + 1); | 72 str.substring(equalsIndex + 1); |
| 73 } | 73 } |
| 74 _environmentCache = new _UnmodifiableMap(result); | 74 _environmentCache = new UnmodifiableMapView(result); |
| 75 } else { | 75 } else { |
| 76 _environmentCache = env; | 76 _environmentCache = env; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 if (_environmentCache is OSError) { | 80 if (_environmentCache is OSError) { |
| 81 throw _environmentCache; | 81 throw _environmentCache; |
| 82 } else { | 82 } else { |
| 83 return _environmentCache; | 83 return _environmentCache; |
| 84 } | 84 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 115 } | 115 } |
| 116 V remove(String key) => _map.remove(key.toUpperCase()); | 116 V remove(String key) => _map.remove(key.toUpperCase()); |
| 117 void clear() => _map.clear(); | 117 void clear() => _map.clear(); |
| 118 void forEach(void f(String key, V value)) => _map.forEach(f); | 118 void forEach(void f(String key, V value)) => _map.forEach(f); |
| 119 Iterable<String> get keys => _map.keys; | 119 Iterable<String> get keys => _map.keys; |
| 120 Iterable<V> get values => _map.values; | 120 Iterable<V> get values => _map.values; |
| 121 int get length => _map.length; | 121 int get length => _map.length; |
| 122 bool get isEmpty => _map.isEmpty; | 122 bool get isEmpty => _map.isEmpty; |
| 123 bool get isNotEmpty => _map.isNotEmpty; | 123 bool get isNotEmpty => _map.isNotEmpty; |
| 124 } | 124 } |
| OLD | NEW |