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 part of dart2js.mirrors; | 5 part of dart2js.mirrors; |
6 | 6 |
7 abstract class ObjectMirrorMixin implements ObjectMirror { | 7 abstract class ObjectMirrorMixin implements ObjectMirror { |
8 InstanceMirror getField(Symbol fieldName) { | 8 InstanceMirror getField(Symbol fieldName) { |
9 throw new UnsupportedError('ObjectMirror.getField unsupported.'); | 9 throw new UnsupportedError('ObjectMirror.getField unsupported.'); |
10 } | 10 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return new Dart2JsMapConstantMirror(mirrorSystem, constant, value); | 49 return new Dart2JsMapConstantMirror(mirrorSystem, constant, value); |
50 } else if (value.isType) { | 50 } else if (value.isType) { |
51 return new Dart2JsTypeConstantMirror(mirrorSystem, constant, value); | 51 return new Dart2JsTypeConstantMirror(mirrorSystem, constant, value); |
52 } else if (value.isFunction) { | 52 } else if (value.isFunction) { |
53 return new Dart2JsConstantMirror(mirrorSystem, constant, value); | 53 return new Dart2JsConstantMirror(mirrorSystem, constant, value); |
54 } else if (value.isNull) { | 54 } else if (value.isNull) { |
55 return new Dart2JsNullConstantMirror(mirrorSystem, constant, value); | 55 return new Dart2JsNullConstantMirror(mirrorSystem, constant, value); |
56 } else if (value.isConstructedObject) { | 56 } else if (value.isConstructedObject) { |
57 return new Dart2JsConstructedConstantMirror(mirrorSystem, constant, value); | 57 return new Dart2JsConstructedConstantMirror(mirrorSystem, constant, value); |
58 } | 58 } |
59 mirrorSystem.compiler.internalError(NO_LOCATION_SPANNABLE, | 59 mirrorSystem.compiler.reporter.internalError(NO_LOCATION_SPANNABLE, |
60 "Unexpected constant value $value"); | 60 "Unexpected constant value $value"); |
61 return null; | 61 return null; |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
66 // Mirrors on constant values used for metadata. | 66 // Mirrors on constant values used for metadata. |
67 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
68 | 68 |
69 class Dart2JsConstantMirror extends Object | 69 class Dart2JsConstantMirror extends Object |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment); | 289 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment); |
290 } else if (fieldName == #text) { | 290 } else if (fieldName == #text) { |
291 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text); | 291 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text); |
292 } else if (fieldName == #trimmedText) { | 292 } else if (fieldName == #trimmedText) { |
293 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, | 293 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, |
294 trimmedText); | 294 trimmedText); |
295 } | 295 } |
296 return super.getField(fieldName); | 296 return super.getField(fieldName); |
297 } | 297 } |
298 } | 298 } |
OLD | NEW |