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 import "dart:nativewrappers"; | |
rmacnak
2013/11/20 00:27:46
We haven't needed this since the introduction of M
| |
6 // TODO(ahe): Move _symbol_dev.Symbol to its own "private" library? | 5 // TODO(ahe): Move _symbol_dev.Symbol to its own "private" library? |
7 import "dart:_collection-dev" as _symbol_dev; | 6 import "dart:_collection-dev" as _symbol_dev; |
8 | 7 |
9 /** | 8 /** |
10 * Returns a [MirrorSystem] for the current isolate. | 9 * Returns a [MirrorSystem] for the current isolate. |
11 */ | 10 */ |
12 patch MirrorSystem currentMirrorSystem() { | 11 patch MirrorSystem currentMirrorSystem() { |
13 return _Mirrors.currentMirrorSystem(); | 12 return _Mirrors.currentMirrorSystem(); |
14 } | 13 } |
15 | 14 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 result.write(char); | 70 result.write(char); |
72 } | 71 } |
73 } | 72 } |
74 if (add_setter_suffix) { | 73 if (add_setter_suffix) { |
75 result.write('='); | 74 result.write('='); |
76 } | 75 } |
77 return result.toString(); | 76 return result.toString(); |
78 } | 77 } |
79 | 78 |
80 /* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) { | 79 /* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) { |
81 if (library is! LibraryMirror || | 80 if ((library != null && library is! _LocalLibraryMirror) || |
ahe
2013/11/21 09:07:02
Why are you checking for is! _LocalLibraryMirror?
| |
82 ((name.length > 0) && (name[0] == '_') && (library == null))) { | 81 ((name.length > 0) && (name[0] == '_') && (library == null))) { |
83 throw new ArgumentError(library); | 82 throw new ArgumentError(library); |
84 } | 83 } |
85 if (library != null) name = _mangleName(name, library._reflectee); | 84 if (library != null) name = _mangleName(name, library._reflectee); |
86 return new _symbol_dev.Symbol.unvalidated(name); | 85 return new _symbol_dev.Symbol.unvalidated(name); |
87 } | 86 } |
88 | 87 |
89 static _mangleName(String name, _MirrorReference lib) | 88 static _mangleName(String name, _MirrorReference lib) |
90 native "Mirrors_mangleName"; | 89 native "Mirrors_mangleName"; |
91 } | 90 } |
92 | 91 |
93 // TODO(rmacnak): Eliminate this class. | 92 // TODO(rmacnak): Eliminate this class. |
94 class MirroredCompilationError { | 93 class MirroredCompilationError { |
95 final String message; | 94 final String message; |
96 | 95 |
97 MirroredCompilationError(this.message); | 96 MirroredCompilationError(this.message); |
98 | 97 |
99 String toString() { | 98 String toString() { |
100 return "Compile-time error during mirrored execution: <$message>"; | 99 return "Compile-time error during mirrored execution: <$message>"; |
101 } | 100 } |
102 } | 101 } |
OLD | NEW |