| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** A formal parameter to a [Method]. */ | 5 /** A formal parameter to a [Method]. */ |
| 6 class Parameter { | 6 class Parameter { |
| 7 FormalNode definition; | 7 FormalNode definition; |
| 8 Member method; | 8 Member method; |
| 9 | 9 |
| 10 String name; | 10 String name; |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 if (arg == null) { | 952 if (arg == null) { |
| 953 arg = parameters[i].value; | 953 arg = parameters[i].value; |
| 954 } else { | 954 } else { |
| 955 arg = arg.convertTo(context, parameters[i].type, node, isDynamic); | 955 arg = arg.convertTo(context, parameters[i].type, node, isDynamic); |
| 956 namedArgsUsed++; | 956 namedArgsUsed++; |
| 957 } | 957 } |
| 958 | 958 |
| 959 if (arg == null || !parameters[i].isOptional) { | 959 if (arg == null || !parameters[i].isOptional) { |
| 960 var msg = _argCountMsg(Math.min(i, args.length), i + 1, atLeast:true); | 960 var msg = _argCountMsg(Math.min(i, args.length), i + 1, atLeast:true); |
| 961 return _argError(context, node, target, args, msg, | 961 return _argError(context, node, target, args, msg, |
| 962 args.nodes[i].span); | 962 (i >= args.nodes.length) ? node.span : args.nodes[i].span); |
| 963 } else { | 963 } else { |
| 964 argsCode.add(isConst && arg.isConst | 964 argsCode.add(isConst && arg.isConst |
| 965 ? arg.canonicalCode : arg.code); | 965 ? arg.canonicalCode : arg.code); |
| 966 } | 966 } |
| 967 } | 967 } |
| 968 Arguments.removeTrailingNulls(argsCode); | 968 Arguments.removeTrailingNulls(argsCode); |
| 969 } | 969 } |
| 970 | 970 |
| 971 if (namedArgsUsed < args.nameCount) { | 971 if (namedArgsUsed < args.nameCount) { |
| 972 // Find the unused argument name | 972 // Find the unused argument name |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 } | 1770 } |
| 1771 | 1771 |
| 1772 void forEach(void f(Member member)) { | 1772 void forEach(void f(Member member)) { |
| 1773 factories.forEach((_, Map constructors) { | 1773 factories.forEach((_, Map constructors) { |
| 1774 constructors.forEach((_, Member member) { | 1774 constructors.forEach((_, Member member) { |
| 1775 f(member); | 1775 f(member); |
| 1776 }); | 1776 }); |
| 1777 }); | 1777 }); |
| 1778 } | 1778 } |
| 1779 } | 1779 } |
| OLD | NEW |