| 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 static final int _METHOD = 0; | 7 // _FIELD cannot be generated by regular invocation mirrors. |
| 8 static final int _GETTER = 1; | 8 static const int _METHOD = 0; |
| 9 static final int _SETTER = 2; | 9 static const int _GETTER = 1; |
| 10 static const int _SETTER = 2; |
| 11 static const int _FIELD = 3; |
| 12 static const int _TYPE_SHIFT = 0; |
| 13 static const int _TYPE_BITS = 2; |
| 14 static const int _TYPE_MASK = (1 << _TYPE_BITS) - 1; |
| 15 |
| 16 // These values, except _DYNAMIC, are only used when throwing |
| 17 // NoSuchMethodError for compile-time resolution failures. |
| 18 static const int _DYNAMIC = 0; |
| 19 static const int _STATIC = 1; |
| 20 static const int _CONSTRUCTOR = 2; |
| 21 static const int _TOP_LEVEL = 3; |
| 22 static const int _CALL_SHIFT = _TYPE_BITS; |
| 23 static const int _CALL_BITS = 2; |
| 24 static const int _CALL_MASK = (1 << _CALL_BITS) - 1; |
| 10 | 25 |
| 11 // Internal representation of the invocation mirror. | 26 // Internal representation of the invocation mirror. |
| 12 final String _functionName; | 27 final String _functionName; |
| 13 final List _argumentsDescriptor; | 28 final List _argumentsDescriptor; |
| 14 final List _arguments; | 29 final List _arguments; |
| 15 | 30 |
| 16 // External representation of the invocation mirror; populated on demand. | 31 // External representation of the invocation mirror; populated on demand. |
| 17 String _memberName; | 32 String _memberName; |
| 18 int _type; | 33 int _type; |
| 19 List _positionalArguments; | 34 List _positionalArguments; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 String functionName, | 120 String functionName, |
| 106 List argumentsDescriptor, | 121 List argumentsDescriptor, |
| 107 List arguments) | 122 List arguments) |
| 108 native "InvocationMirror_invoke"; | 123 native "InvocationMirror_invoke"; |
| 109 | 124 |
| 110 invokeOn(Object receiver) { | 125 invokeOn(Object receiver) { |
| 111 return _invoke(receiver, _functionName, _argumentsDescriptor, _arguments); | 126 return _invoke(receiver, _functionName, _argumentsDescriptor, _arguments); |
| 112 } | 127 } |
| 113 } | 128 } |
| 114 | 129 |
| OLD | NEW |