| 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 Invocation { | 5 class _InvocationMirror implements Invocation { |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 List get positionalArguments { | 62 List get positionalArguments { |
| 63 if (_positionalArguments == null) { | 63 if (_positionalArguments == null) { |
| 64 int numPositionalArguments = _argumentsDescriptor[1]; | 64 int numPositionalArguments = _argumentsDescriptor[1]; |
| 65 // Don't count receiver. | 65 // Don't count receiver. |
| 66 if (numPositionalArguments == 1) { | 66 if (numPositionalArguments == 1) { |
| 67 return _positionalArguments = const []; | 67 return _positionalArguments = const []; |
| 68 } | 68 } |
| 69 // Exclude receiver. | 69 // Exclude receiver. |
| 70 _positionalArguments = _arguments.sublist(1, numPositionalArguments); | 70 _positionalArguments = |
| 71 new _ImmutableList._from(_arguments, 1, numPositionalArguments - 1); |
| 71 } | 72 } |
| 72 return _positionalArguments; | 73 return _positionalArguments; |
| 73 } | 74 } |
| 74 | 75 |
| 75 Map<Symbol, dynamic> get namedArguments { | 76 Map<Symbol, dynamic> get namedArguments { |
| 76 if (_namedArguments == null) { | 77 if (_namedArguments == null) { |
| 77 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. | 78 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. |
| 78 int numPositionalArguments = _argumentsDescriptor[1] - 1; | 79 int numPositionalArguments = _argumentsDescriptor[1] - 1; |
| 79 int numNamedArguments = numArguments - numPositionalArguments; | 80 int numNamedArguments = numArguments - numPositionalArguments; |
| 80 if (numNamedArguments == 0) { | 81 if (numNamedArguments == 0) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 static _allocateInvocationMirror(String functionName, | 128 static _allocateInvocationMirror(String functionName, |
| 128 List argumentsDescriptor, | 129 List argumentsDescriptor, |
| 129 List arguments, | 130 List arguments, |
| 130 bool isSuperInvocation) { | 131 bool isSuperInvocation) { |
| 131 return new _InvocationMirror(functionName, | 132 return new _InvocationMirror(functionName, |
| 132 argumentsDescriptor, | 133 argumentsDescriptor, |
| 133 arguments, | 134 arguments, |
| 134 isSuperInvocation); | 135 isSuperInvocation); |
| 135 } | 136 } |
| 136 } | 137 } |
| OLD | NEW |