| 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 } |
| 11 | 11 |
| 12 InstanceMirror setField(Symbol fieldName, Object value) { | 12 InstanceMirror setField(Symbol fieldName, Object value) { |
| 13 throw new UnsupportedError('ObjectMirror.setField unsupported.'); | 13 throw new UnsupportedError('ObjectMirror.setField unsupported.'); |
| 14 } | 14 } |
| 15 | 15 |
| 16 InstanceMirror invoke(Symbol memberName, | 16 InstanceMirror invoke(Symbol memberName, |
| 17 List positionalArguments, | 17 List positionalArguments, |
| 18 [Map<Symbol, dynamic> namedArguments]) { | 18 [Map<Symbol, dynamic> namedArguments]) { |
| 19 throw new UnsupportedError('ObjectMirror.invoke unsupported.'); | 19 throw new UnsupportedError('ObjectMirror.invoke unsupported.'); |
| 20 } | 20 } |
| 21 |
| 22 delegate(Invocation invocation) { |
| 23 throw new UnsupportedError('ObjectMirror.delegate unsupported'); |
| 24 } |
| 21 } | 25 } |
| 22 | 26 |
| 23 abstract class InstanceMirrorMixin implements InstanceMirror { | 27 abstract class InstanceMirrorMixin implements InstanceMirror { |
| 24 bool get hasReflectee => false; | 28 bool get hasReflectee => false; |
| 25 | 29 |
| 26 get reflectee { | 30 get reflectee { |
| 27 throw new UnsupportedError('InstanceMirror.reflectee unsupported.'); | 31 throw new UnsupportedError('InstanceMirror.reflectee unsupported.'); |
| 28 } | 32 } |
| 29 | |
| 30 delegate(Invocation invocation) { | |
| 31 throw new UnsupportedError('InstanceMirror.delegate unsupported'); | |
| 32 } | |
| 33 } | 33 } |
| 34 | 34 |
| 35 InstanceMirror _convertConstantToInstanceMirror( | 35 InstanceMirror _convertConstantToInstanceMirror( |
| 36 Dart2JsMirrorSystem mirrorSystem, | 36 Dart2JsMirrorSystem mirrorSystem, |
| 37 ConstantExpression constant, | 37 ConstantExpression constant, |
| 38 ConstantValue value) { | 38 ConstantValue value) { |
| 39 | 39 |
| 40 if (value.isBool) { | 40 if (value.isBool) { |
| 41 return new Dart2JsBoolConstantMirror(mirrorSystem, constant, value); | 41 return new Dart2JsBoolConstantMirror(mirrorSystem, constant, value); |
| 42 } else if (value.isNum) { | 42 } else if (value.isNum) { |
| (...skipping 246 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 |