Chromium Code Reviews| Index: runtime/lib/mirrors_impl.dart |
| diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart |
| index 498e4698bac865b42ea7282e64a763b3a064d0e4..8c91b8535a00d82a122bf8a6d625565ece47db0c 100644 |
| --- a/runtime/lib/mirrors_impl.dart |
| +++ b/runtime/lib/mirrors_impl.dart |
| @@ -1089,27 +1089,33 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl |
| DeclarationMirror owner, |
| this._position, |
| this.isOptional, |
| - this.isNamed) |
| + this.isNamed, |
| + bool isFinal, |
| + this._defaultValueReflectee) |
| : super(reflectee, |
| simpleName, |
| owner, |
| null, // We override the type. |
| false, // isStatic does not apply. |
| - false); // TODO(12196): Not yet implemented. |
| + isFinal); |
| final int _position; |
| final bool isOptional; |
| final bool isNamed; |
| - String get defaultValue { |
| - throw new UnimplementedError( |
| - 'ParameterMirror.defaultValue is not implemented'); |
| + Object _defaultValueReflectee; |
| + InstanceMirror _defaultValue = null; |
|
ahe
2013/08/27 16:48:38
No need to initialize to null.
Michael Lippautz (Google)
2013/08/27 17:30:15
Done.
|
| + InstanceMirror get defaultValue { |
| + if (!isOptional) { |
| + return null; |
| + } |
| + if (_defaultValue == null) { |
| + _defaultValue = reflect(_defaultValueReflectee); |
| + } |
| + return _defaultValue; |
| } |
| - bool get hasDefaultValue { |
| - throw new UnimplementedError( |
| - 'ParameterMirror.hasDefaultValue is not implemented'); |
| - } |
| + bool get hasDefaultValue => _defaultValueReflectee != null; |
| // TODO(11418): Implement. |
| List<InstanceMirror> get metadata { |