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

Side by Side Diff: pkg/analyzer/lib/src/services/runtime/coverage/coverage_impl.dart

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « pkg/analyzer/lib/options.dart ('k') | pkg/docgen/lib/docgen.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 /// A library for code coverage support for Dart. 5 /// A library for code coverage support for Dart.
6 library runtime.coverage.impl; 6 library runtime.coverage.impl;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection' show SplayTreeMap; 9 import 'dart:collection' show SplayTreeMap;
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 }).catchError((e) { 183 }).catchError((e) {
184 log.severe('Error in receiving statistics $e.'); 184 log.severe('Error in receiving statistics $e.');
185 return request.response.close(); 185 return request.response.close();
186 }); 186 });
187 }); 187 });
188 } 188 }
189 189
190 String rewritePathContent(String path) { 190 String rewritePathContent(String path) {
191 if (path.endsWith('__coverage_lib.dart')) { 191 if (path.endsWith('__coverage_lib.dart')) {
192 String implPath = pathos.joinAll([ 192 String implPath = pathos.joinAll([
193 pathos.dirname(Platform.script.toFilePath()), 193 pathos.dirname(Platform.script),
194 '..', 'lib', 'src', 'services', 'runtime', 'coverage', 194 '..', 'lib', 'src', 'services', 'runtime', 'coverage',
195 'coverage_lib.dart']); 195 'coverage_lib.dart']);
196 var content = new File(implPath).readAsStringSync(); 196 var content = new File(implPath).readAsStringSync();
197 return content.replaceAll('0; // replaced during rewrite', '$port;'); 197 return content.replaceAll('0; // replaced during rewrite', '$port;');
198 } 198 }
199 return null; 199 return null;
200 } 200 }
201 201
202 bool shouldRewriteFile(String path) { 202 bool shouldRewriteFile(String path) {
203 if (pathos.extension(path).toLowerCase() != '.dart') return false; 203 if (pathos.extension(path).toLowerCase() != '.dart') return false;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 var lastOffset = 0; 331 var lastOffset = 0;
332 offsetFragmentMap.forEach((offset, fragment) { 332 offsetFragmentMap.forEach((offset, fragment) {
333 sb.write(_code.substring(lastOffset, offset)); 333 sb.write(_code.substring(lastOffset, offset));
334 sb.write(fragment); 334 sb.write(fragment);
335 lastOffset = offset; 335 lastOffset = offset;
336 }); 336 });
337 sb.write(_code.substring(lastOffset, _code.length)); 337 sb.write(_code.substring(lastOffset, _code.length));
338 return sb.toString(); 338 return sb.toString();
339 } 339 }
340 } 340 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/options.dart ('k') | pkg/docgen/lib/docgen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698