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

Side by Side Diff: frog/member.dart

Issue 8912017: Fix missing trampolines for named arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove 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 | « frog/gen.dart ('k') | frog/minfrog » ('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 bool namesInHomePositions(Arguments args) {
Jennifer Messerly 2011/12/14 19:15:33 mind adding a comment to this? I'm not familiar wi
sra1 2011/12/14 22:04:32 Done.
821 if (!args.hasNames) return true;
822
823 for (int i = args.bareCount; i < args.values.length; i++) {
824 if (i >= parameters.length)
Jennifer Messerly 2011/12/14 19:15:33 style nit: ifs should be one line, or use { ... }
sra1 2011/12/14 22:04:32 Done.
825 return false;
826 if (args.getName(i) != parameters[i].name)
827 return false;
828 }
829 return true;
830 }
831
820 bool namesInOrder(Arguments args) { 832 bool namesInOrder(Arguments args) {
821 if (!args.hasNames) return true; 833 if (!args.hasNames) return true;
822 834
823 int lastParameter = null; 835 int lastParameter = null;
824 for (int i = args.bareCount; i < parameters.length; i++) { 836 for (int i = args.bareCount; i < parameters.length; i++) {
825 var p = args.getIndexOfName(parameters[i].name); 837 var p = args.getIndexOfName(parameters[i].name);
826 // Only worry about parameters that needTemps. Otherwise it's fine to 838 // Only worry about parameters that needTemps. Otherwise it's fine to
827 // reorder. 839 // reorder.
828 if (p >= 0 && args.values[p].needsTemp) { 840 if (p >= 0 && args.values[p].needsTemp) {
829 if (lastParameter != null && lastParameter > p) { 841 if (lastParameter != null && lastParameter > p) {
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 } 1790 }
1779 1791
1780 void forEach(void f(Member member)) { 1792 void forEach(void f(Member member)) {
1781 factories.forEach((_, Map constructors) { 1793 factories.forEach((_, Map constructors) {
1782 constructors.forEach((_, Member member) { 1794 constructors.forEach((_, Member member) {
1783 f(member); 1795 f(member);
1784 }); 1796 });
1785 }); 1797 });
1786 } 1798 }
1787 } 1799 }
OLDNEW
« no previous file with comments | « frog/gen.dart ('k') | frog/minfrog » ('j') | frog/var_member.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698