| 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 'dart:_js_embedded_names' show | 7 import 'dart:_js_embedded_names' show |
| 8 ALL_CLASSES, | 8 ALL_CLASSES, |
| 9 LAZIES, | 9 LAZIES, |
| 10 LIBRARIES, | 10 LIBRARIES, |
| (...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1666 if (typeVariables.isEmpty) return _jsConstructor; | 1666 if (typeVariables.isEmpty) return _jsConstructor; |
| 1667 var type = [_jsConstructor]; | 1667 var type = [_jsConstructor]; |
| 1668 for (int i = 0; i < typeVariables.length; i ++) { | 1668 for (int i = 0; i < typeVariables.length; i ++) { |
| 1669 type.add(JsMirrorSystem._dynamicType._asRuntimeType); | 1669 type.add(JsMirrorSystem._dynamicType._asRuntimeType); |
| 1670 } | 1670 } |
| 1671 return type; | 1671 return type; |
| 1672 } | 1672 } |
| 1673 | 1673 |
| 1674 List<JsMethodMirror> _getMethodsWithOwner(DeclarationMirror methodOwner) { | 1674 List<JsMethodMirror> _getMethodsWithOwner(DeclarationMirror methodOwner) { |
| 1675 var prototype = JS('', '#.prototype', _jsConstructor); | 1675 var prototype = JS('', '#.prototype', _jsConstructor); |
| 1676 // The prototype might not have been processed yet, so do that now. |
| 1677 if (JS('bool', '!!#.\$deferredAction', prototype)) { |
| 1678 JS('', '#.\$deferredAction()', prototype); |
| 1679 } |
| 1676 List<String> keys = extractKeys(prototype); | 1680 List<String> keys = extractKeys(prototype); |
| 1677 var result = <JsMethodMirror>[]; | 1681 var result = <JsMethodMirror>[]; |
| 1678 for (String key in keys) { | 1682 for (String key in keys) { |
| 1679 if (isReflectiveDataInPrototype(key)) continue; | 1683 if (isReflectiveDataInPrototype(key)) continue; |
| 1680 String simpleName = mangledNames[key]; | 1684 String simpleName = mangledNames[key]; |
| 1681 // [simpleName] can be null if [key] represents an implementation | 1685 // [simpleName] can be null if [key] represents an implementation |
| 1682 // detail, for example, a bailout method, or runtime type support. | 1686 // detail, for example, a bailout method, or runtime type support. |
| 1683 // It might also be null if the user has limited what is reified for | 1687 // It might also be null if the user has limited what is reified for |
| 1684 // reflection with metadata. | 1688 // reflection with metadata. |
| 1685 if (simpleName == null) continue; | 1689 if (simpleName == null) continue; |
| (...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3027 // have a part (following a '.') that starts with '_'. | 3031 // have a part (following a '.') that starts with '_'. |
| 3028 const int UNDERSCORE = 0x5f; | 3032 const int UNDERSCORE = 0x5f; |
| 3029 if (name.isEmpty) return true; | 3033 if (name.isEmpty) return true; |
| 3030 int index = -1; | 3034 int index = -1; |
| 3031 do { | 3035 do { |
| 3032 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; | 3036 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; |
| 3033 index = name.indexOf('.', index + 1); | 3037 index = name.indexOf('.', index + 1); |
| 3034 } while (index >= 0 && index + 1 < name.length); | 3038 } while (index >= 0 && index + 1 < name.length); |
| 3035 return true; | 3039 return true; |
| 3036 } | 3040 } |
| OLD | NEW |