Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Side by Side Diff: runtime/bin/process_patch.dart

Issue 123263003: Make the Platform.environment return value an unmodifiable map (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/io/platform.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 patch class _WindowsCodePageDecoder { 5 patch class _WindowsCodePageDecoder {
6 /* patch */ static String _decodeBytes(List<int> bytes) 6 /* patch */ static String _decodeBytes(List<int> bytes)
7 native "SystemEncodingToString"; 7 native "SystemEncodingToString";
8 } 8 }
9 9
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 192
193 _environment = []; 193 _environment = [];
194 if (environment == null) { 194 if (environment == null) {
195 environment = {}; 195 environment = {};
196 } 196 }
197 if (environment is !Map) { 197 if (environment is !Map) {
198 throw new ArgumentError("Environment is not a map: $environment"); 198 throw new ArgumentError("Environment is not a map: $environment");
199 } 199 }
200 if (identical(true, includeParentEnvironment)) { 200 if (identical(true, includeParentEnvironment)) {
201 environment = Platform.environment..addAll(environment); 201 environment = new Map.from(Platform.environment)..addAll(environment);
202 } 202 }
203 environment.forEach((key, value) { 203 environment.forEach((key, value) {
204 if (key is !String || value is !String) { 204 if (key is !String || value is !String) {
205 throw new ArgumentError( 205 throw new ArgumentError(
206 "Environment key or value is not a string: ($key, $value)"); 206 "Environment key or value is not a string: ($key, $value)");
207 } 207 }
208 _environment.add('$key=$value'); 208 _environment.add('$key=$value');
209 }); 209 });
210 210
211 // stdin going to process. 211 // stdin going to process.
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 const _ProcessResult(int this.pid, 532 const _ProcessResult(int this.pid,
533 int this.exitCode, 533 int this.exitCode,
534 this.stdout, 534 this.stdout,
535 this.stderr); 535 this.stderr);
536 536
537 final int pid; 537 final int pid;
538 final int exitCode; 538 final int exitCode;
539 final stdout; 539 final stdout;
540 final stderr; 540 final stderr;
541 } 541 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/io/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698