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 JsGetName, | 8 JsGetName, |
9 ALL_CLASSES, | 9 ALL_CLASSES, |
10 LAZIES, | 10 LAZIES, |
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 if (!hasSetter) { | 2163 if (!hasSetter) { |
2164 // TODO(ahe): This is a hack to handle checked setters in checked mode. | 2164 // TODO(ahe): This is a hack to handle checked setters in checked mode. |
2165 var setterName = s('$unmangledName='); | 2165 var setterName = s('$unmangledName='); |
2166 for (JsMethodMirror method in owner._methods) { | 2166 for (JsMethodMirror method in owner._methods) { |
2167 if (method.simpleName == setterName) { | 2167 if (method.simpleName == setterName) { |
2168 isFinal = false; | 2168 isFinal = false; |
2169 break; | 2169 break; |
2170 } | 2170 } |
2171 } | 2171 } |
2172 } | 2172 } |
2173 int type = int.parse(fieldInformation[1]); | 2173 int type = int.parse(fieldInformation[1], onError: (_) => null); |
2174 return new JsVariableMirror(s(unmangledName), | 2174 return new JsVariableMirror(s(unmangledName), |
2175 jsName, | 2175 jsName, |
2176 type, | 2176 type, |
2177 isFinal, | 2177 isFinal, |
2178 isStatic, | 2178 isStatic, |
2179 metadataFunction, | 2179 metadataFunction, |
2180 owner); | 2180 owner); |
2181 } | 2181 } |
2182 | 2182 |
2183 String get _prettyName => 'VariableMirror'; | 2183 String get _prettyName => 'VariableMirror'; |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 // have a part (following a '.') that starts with '_'. | 3046 // have a part (following a '.') that starts with '_'. |
3047 const int UNDERSCORE = 0x5f; | 3047 const int UNDERSCORE = 0x5f; |
3048 if (name.isEmpty) return true; | 3048 if (name.isEmpty) return true; |
3049 int index = -1; | 3049 int index = -1; |
3050 do { | 3050 do { |
3051 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; | 3051 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; |
3052 index = name.indexOf('.', index + 1); | 3052 index = name.indexOf('.', index + 1); |
3053 } while (index >= 0 && index + 1 < name.length); | 3053 } while (index >= 0 && index + 1 < name.length); |
3054 return true; | 3054 return true; |
3055 } | 3055 } |
OLD | NEW |