| 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 library dart2js.mirrors; | 5 library dart2js.mirrors; |
| 6 | 6 |
| 7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView; | 7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView; |
| 8 | 8 |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 commentToken = commentToken.next; | 223 commentToken = commentToken.next; |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 List<InstanceMirror> get metadata { | 227 List<InstanceMirror> get metadata { |
| 228 if (_metadata == null) { | 228 if (_metadata == null) { |
| 229 _metadata = <InstanceMirror>[]; | 229 _metadata = <InstanceMirror>[]; |
| 230 for (MetadataAnnotation metadata in _element.metadata) { | 230 for (MetadataAnnotation metadata in _element.metadata) { |
| 231 _appendCommentTokens( | 231 _appendCommentTokens( |
| 232 mirrorSystem.compiler.commentMap[metadata.beginToken]); | 232 mirrorSystem.compiler.commentMap[metadata.beginToken]); |
| 233 metadata.ensureResolved(mirrorSystem.compiler); | 233 metadata.ensureResolved(mirrorSystem.compiler.resolution); |
| 234 _metadata.add(_convertConstantToInstanceMirror( | 234 _metadata.add(_convertConstantToInstanceMirror( |
| 235 mirrorSystem, metadata.constant, | 235 mirrorSystem, metadata.constant, |
| 236 mirrorSystem.compiler.constants.getConstantValue( | 236 mirrorSystem.compiler.constants.getConstantValue( |
| 237 metadata.constant))); | 237 metadata.constant))); |
| 238 } | 238 } |
| 239 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]); | 239 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]); |
| 240 } | 240 } |
| 241 // TODO(johnniwinther): Return an unmodifiable list instead. | 241 // TODO(johnniwinther): Return an unmodifiable list instead. |
| 242 return new List<InstanceMirror>.from(_metadata); | 242 return new List<InstanceMirror>.from(_metadata); |
| 243 } | 243 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (!parameter.hasDefaultValue) return null; | 486 if (!parameter.hasDefaultValue) return null; |
| 487 ParameterElement parameterElement = parameter._element; | 487 ParameterElement parameterElement = parameter._element; |
| 488 Compiler compiler = parameter.mirrorSystem.compiler; | 488 Compiler compiler = parameter.mirrorSystem.compiler; |
| 489 return compiler.constants.getConstantForVariable(parameterElement); | 489 return compiler.constants.getConstantForVariable(parameterElement); |
| 490 } | 490 } |
| 491 | 491 |
| 492 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) { | 492 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) { |
| 493 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element); | 493 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element); |
| 494 } | 494 } |
| 495 } | 495 } |
| OLD | NEW |