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

Side by Side Diff: dart/sdk/lib/_internal/pub/lib/src/utils.dart

Issue 23455028: Mirrors overhaul. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r29550. 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 | « dart/sdk/lib/_internal/lib/js_mirrors.dart ('k') | dart/sdk/lib/mirrors/mirrors.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) 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 /// Generic utility functions. Stuff that should possibly be in core. 5 /// Generic utility functions. Stuff that should possibly be in core.
6 library pub.utils; 6 library pub.utils;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import "dart:collection"; 9 import "dart:collection";
10 import "dart:convert"; 10 import "dart:convert";
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 for (var pair in resolvedPairs) { 565 for (var pair in resolvedPairs) {
566 map[pair.first] = pair.last; 566 map[pair.first] = pair.last;
567 } 567 }
568 return map; 568 return map;
569 }); 569 });
570 } 570 }
571 571
572 /// Returns the path to the library named [libraryName]. The library name must 572 /// Returns the path to the library named [libraryName]. The library name must
573 /// be globally unique, or the wrong library path may be returned. 573 /// be globally unique, or the wrong library path may be returned.
574 String libraryPath(String libraryName) { 574 String libraryPath(String libraryName) {
575 var libraries = currentMirrorSystem().findLibrary(new Symbol(libraryName)); 575 var lib = currentMirrorSystem().findLibrary(new Symbol(libraryName));
576 return path.fromUri(libraries.single.uri); 576 return path.fromUri(lib.uri);
577 } 577 }
578 578
579 /// Gets a "special" string (ANSI escape or Unicode). On Windows, returns 579 /// Gets a "special" string (ANSI escape or Unicode). On Windows, returns
580 /// something else since those aren't supported. 580 /// something else since those aren't supported.
581 String getSpecial(String color, [String onWindows = '']) { 581 String getSpecial(String color, [String onWindows = '']) {
582 // No ANSI escapes on windows or when running tests. 582 // No ANSI escapes on windows or when running tests.
583 if (runningAsTest || Platform.operatingSystem == 'windows') return onWindows; 583 if (runningAsTest || Platform.operatingSystem == 'windows') return onWindows;
584 return color; 584 return color;
585 } 585 }
586 586
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 error is AnalyzerErrorGroup || 750 error is AnalyzerErrorGroup ||
751 error is IsolateSpawnException || 751 error is IsolateSpawnException ||
752 error is FileSystemException || 752 error is FileSystemException ||
753 error is HttpException || 753 error is HttpException ||
754 error is HttpException || 754 error is HttpException ||
755 error is OSError || 755 error is OSError ||
756 error is ProcessException || 756 error is ProcessException ||
757 error is SocketException || 757 error is SocketException ||
758 error is WebSocketException; 758 error is WebSocketException;
759 } 759 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_mirrors.dart ('k') | dart/sdk/lib/mirrors/mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698