Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: frog/member.dart

Issue 8966026: When generating the error message, don't overrun args.nodes . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/minfrog » ('j') | tests/language/src/Constructor3NegativeTest.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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) ? null : args.nodes[i].span);
jimhug 2011/12/16 17:29:39 A better fix would be to use node.span instead of
dgrove 2011/12/16 17:49:56 Done.
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
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 }
OLDNEW
« no previous file with comments | « no previous file | frog/minfrog » ('j') | tests/language/src/Constructor3NegativeTest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698