OLD | NEW |
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 library dart._js_mirrors; | 5 library dart._js_mirrors; |
6 | 6 |
7 import 'shared/runtime_data.dart' as encoding; | 7 import 'shared/runtime_data.dart' as encoding; |
8 import 'shared/embedded_names.dart' show | 8 import 'shared/embedded_names.dart' show |
9 ALL_CLASSES, | 9 ALL_CLASSES, |
10 LAZIES, | 10 LAZIES, |
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2758 } | 2758 } |
2759 return typeArgument._mangledName; | 2759 return typeArgument._mangledName; |
2760 } | 2760 } |
2761 representation = | 2761 representation = |
2762 runtimeTypeToString(type, onTypeVariable: substituteTypeVariable); | 2762 runtimeTypeToString(type, onTypeVariable: substituteTypeVariable); |
2763 } | 2763 } |
2764 if (representation != null) { | 2764 if (representation != null) { |
2765 return reflectClassByMangledName( | 2765 return reflectClassByMangledName( |
2766 getMangledTypeName(createRuntimeType(representation))); | 2766 getMangledTypeName(createRuntimeType(representation))); |
2767 } | 2767 } |
2768 if (type != null && JS('Object|Null', '#.typedef', type) != null) { | 2768 if (type != null && JS('', '#.typedef', type) != null) { |
2769 return typeMirrorFromRuntimeTypeRepresentation( | 2769 return typeMirrorFromRuntimeTypeRepresentation( |
2770 owner, JS('Object', '#.typedef', type)); | 2770 owner, JS('', '#.typedef', type)); |
2771 } else if (type != null && JS('Object|Null', '#.func', type) != null) { | 2771 } else if (type != null && JS('', '#.func', type) != null) { |
2772 return new JsFunctionTypeMirror(type, owner); | 2772 return new JsFunctionTypeMirror(type, owner); |
2773 } | 2773 } |
2774 return reflectClass(Function); | 2774 return reflectClass(Function); |
2775 } | 2775 } |
2776 | 2776 |
2777 Symbol computeQualifiedName(DeclarationMirror owner, Symbol simpleName) { | 2777 Symbol computeQualifiedName(DeclarationMirror owner, Symbol simpleName) { |
2778 if (owner == null) return simpleName; | 2778 if (owner == null) return simpleName; |
2779 String ownerName = n(owner.qualifiedName); | 2779 String ownerName = n(owner.qualifiedName); |
2780 return s('$ownerName.${n(simpleName)}'); | 2780 return s('$ownerName.${n(simpleName)}'); |
2781 } | 2781 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2937 // have a part (following a '.') that starts with '_'. | 2937 // have a part (following a '.') that starts with '_'. |
2938 const int UNDERSCORE = 0x5f; | 2938 const int UNDERSCORE = 0x5f; |
2939 if (name.isEmpty) return true; | 2939 if (name.isEmpty) return true; |
2940 int index = -1; | 2940 int index = -1; |
2941 do { | 2941 do { |
2942 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; | 2942 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; |
2943 index = name.indexOf('.', index + 1); | 2943 index = name.indexOf('.', index + 1); |
2944 } while (index >= 0 && index + 1 < name.length); | 2944 } while (index >= 0 && index + 1 < name.length); |
2945 return true; | 2945 return true; |
2946 } | 2946 } |
OLD | NEW |