| 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 library elements; | 5 library elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 * | 875 * |
| 876 * Returns [:true:] if the signature of the [caller] matches the | 876 * Returns [:true:] if the signature of the [caller] matches the |
| 877 * signature of the [callee], [:false:] otherwise. | 877 * signature of the [callee], [:false:] otherwise. |
| 878 */ | 878 */ |
| 879 static bool addForwardingElementArgumentsToList<T>( | 879 static bool addForwardingElementArgumentsToList<T>( |
| 880 ConstructorElement caller, | 880 ConstructorElement caller, |
| 881 List<T> list, | 881 List<T> list, |
| 882 ConstructorElement callee, | 882 ConstructorElement callee, |
| 883 T compileArgument(ParameterElement element), | 883 T compileArgument(ParameterElement element), |
| 884 T compileConstant(ParameterElement element)) { | 884 T compileConstant(ParameterElement element)) { |
| 885 assert(invariant(caller, !callee.isMalformed, | 885 assert( |
| 886 message: "Cannot compute arguments to malformed constructor: " | 886 !callee.isMalformed, |
| 887 failedAt( |
| 888 caller, |
| 889 "Cannot compute arguments to malformed constructor: " |
| 887 "$caller calling $callee.")); | 890 "$caller calling $callee.")); |
| 888 | 891 |
| 889 FunctionSignature signature = caller.functionSignature; | 892 FunctionSignature signature = caller.functionSignature; |
| 890 Map<Node, ParameterElement> mapping = <Node, ParameterElement>{}; | 893 Map<Node, ParameterElement> mapping = <Node, ParameterElement>{}; |
| 891 | 894 |
| 892 // TODO(ngeoffray): This is a hack that fakes up AST nodes, so | 895 // TODO(ngeoffray): This is a hack that fakes up AST nodes, so |
| 893 // that we can call [addArgumentsToList]. | 896 // that we can call [addArgumentsToList]. |
| 894 Link<Node> computeCallNodesFromParameters() { | 897 Link<Node> computeCallNodesFromParameters() { |
| 895 LinkBuilder<Node> builder = new LinkBuilder<Node>(); | 898 LinkBuilder<Node> builder = new LinkBuilder<Node>(); |
| 896 signature.forEachRequiredParameter((ParameterElement element) { | 899 signature.forEachRequiredParameter((ParameterElement element) { |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 /// by a field. | 1980 /// by a field. |
| 1978 bool get isDeclaredByField; | 1981 bool get isDeclaredByField; |
| 1979 | 1982 |
| 1980 /// Returns `true` if this member is abstract. | 1983 /// Returns `true` if this member is abstract. |
| 1981 bool get isAbstract; | 1984 bool get isAbstract; |
| 1982 | 1985 |
| 1983 /// If abstract, [implementation] points to the overridden concrete member, | 1986 /// If abstract, [implementation] points to the overridden concrete member, |
| 1984 /// if any. Otherwise [implementation] points to the member itself. | 1987 /// if any. Otherwise [implementation] points to the member itself. |
| 1985 Member get implementation; | 1988 Member get implementation; |
| 1986 } | 1989 } |
| OLD | NEW |