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

Side by Side Diff: frog/member.dart

Issue 8915021: Code review changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comment 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/var_member.dart » ('j') | frog/var_member.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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 // TODO(sigmund): can we avoid generating the entire type, but only what 810 // TODO(sigmund): can we avoid generating the entire type, but only what
811 // we need? 811 // we need?
812 declaringType.markUsed(); 812 declaringType.markUsed();
813 var type = declaringType.isTop ? '' : '${declaringType.jsname}.'; 813 var type = declaringType.isTop ? '' : '${declaringType.jsname}.';
814 return new Value(functionType, '$type$jsname', node.span); 814 return new Value(functionType, '$type$jsname', node.span);
815 } 815 }
816 _providePropertySyntax = true; 816 _providePropertySyntax = true;
817 return new Value(functionType, '${target.code}.get\$$jsname()', node.span); 817 return new Value(functionType, '${target.code}.get\$$jsname()', node.span);
818 } 818 }
819 819
820 /**
821 * Checks if the named arguments are in their natural or 'home' positions,
822 * i.e. they may be passed directly without inserting, deleting or moving the
823 * arguments to correspond with the parameters.
824 */
820 bool namesInHomePositions(Arguments args) { 825 bool namesInHomePositions(Arguments args) {
821 if (!args.hasNames) return true; 826 if (!args.hasNames) return true;
822 827
823 for (int i = args.bareCount; i < args.values.length; i++) { 828 for (int i = args.bareCount; i < args.values.length; i++) {
824 if (i >= parameters.length) 829 if (i >= parameters.length) {
825 return false; 830 return false;
826 if (args.getName(i) != parameters[i].name) 831 }
832 if (args.getName(i) != parameters[i].name) {
827 return false; 833 return false;
834 }
828 } 835 }
829 return true; 836 return true;
830 } 837 }
831 838
832 bool namesInOrder(Arguments args) { 839 bool namesInOrder(Arguments args) {
833 if (!args.hasNames) return true; 840 if (!args.hasNames) return true;
834 841
835 int lastParameter = null; 842 int lastParameter = null;
836 for (int i = args.bareCount; i < parameters.length; i++) { 843 for (int i = args.bareCount; i < parameters.length; i++) {
837 var p = args.getIndexOfName(parameters[i].name); 844 var p = args.getIndexOfName(parameters[i].name);
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 } 1797 }
1791 1798
1792 void forEach(void f(Member member)) { 1799 void forEach(void f(Member member)) {
1793 factories.forEach((_, Map constructors) { 1800 factories.forEach((_, Map constructors) {
1794 constructors.forEach((_, Member member) { 1801 constructors.forEach((_, Member member) {
1795 f(member); 1802 f(member);
1796 }); 1803 });
1797 }); 1804 });
1798 } 1805 }
1799 } 1806 }
OLDNEW
« no previous file with comments | « no previous file | frog/var_member.dart » ('j') | frog/var_member.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698