| 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 class _InvocationMirror implements InvocationMirror { | 5 class _InvocationMirror implements InvocationMirror { |
| 6 // Constants describing the invocation type. | 6 // Constants describing the invocation type. |
| 7 // _FIELD cannot be generated by regular invocation mirrors. | 7 // _FIELD cannot be generated by regular invocation mirrors. |
| 8 static const int _METHOD = 0; | 8 static const int _METHOD = 0; |
| 9 static const int _GETTER = 1; | 9 static const int _GETTER = 1; |
| 10 static const int _SETTER = 2; | 10 static const int _SETTER = 2; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 String get memberName { | 50 String get memberName { |
| 51 if (_memberName == null) { | 51 if (_memberName == null) { |
| 52 _setMemberNameAndType(); | 52 _setMemberNameAndType(); |
| 53 } | 53 } |
| 54 return _memberName; | 54 return _memberName; |
| 55 } | 55 } |
| 56 | 56 |
| 57 List get positionalArguments { | 57 List get positionalArguments { |
| 58 if (_positionalArguments == null) { | 58 if (_positionalArguments == null) { |
| 59 int numPositionalArguments = _argumentsDescriptor[1]; |
| 59 // Exclude receiver. | 60 // Exclude receiver. |
| 60 int numPositionalArguments = _argumentsDescriptor[1] - 1; | 61 _positionalArguments = _arguments.sublist(1, numPositionalArguments); |
| 61 _positionalArguments = _arguments.getRange(1, numPositionalArguments); | |
| 62 } | 62 } |
| 63 return _positionalArguments; | 63 return _positionalArguments; |
| 64 } | 64 } |
| 65 | 65 |
| 66 Map<String, dynamic> get namedArguments { | 66 Map<String, dynamic> get namedArguments { |
| 67 if (_namedArguments == null) { | 67 if (_namedArguments == null) { |
| 68 _namedArguments = new Map<String, dynamic>(); | 68 _namedArguments = new Map<String, dynamic>(); |
| 69 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. | 69 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. |
| 70 int numPositionalArguments = _argumentsDescriptor[1] - 1; | 70 int numPositionalArguments = _argumentsDescriptor[1] - 1; |
| 71 int numNamedArguments = numArguments - numPositionalArguments; | 71 int numNamedArguments = numArguments - numPositionalArguments; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 String functionName, | 120 String functionName, |
| 121 List argumentsDescriptor, | 121 List argumentsDescriptor, |
| 122 List arguments) | 122 List arguments) |
| 123 native "InvocationMirror_invoke"; | 123 native "InvocationMirror_invoke"; |
| 124 | 124 |
| 125 invokeOn(Object receiver) { | 125 invokeOn(Object receiver) { |
| 126 return _invoke(receiver, _functionName, _argumentsDescriptor, _arguments); | 126 return _invoke(receiver, _functionName, _argumentsDescriptor, _arguments); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| OLD | NEW |