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

Side by Side Diff: dart/lib/compiler/implementation/typechecker.dart

Issue 10441071: Use the typedef arity to know how to invoke a closure given by the dom. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 months 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
OLDNEW
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 class TypeCheckerTask extends CompilerTask { 5 class TypeCheckerTask extends CompilerTask {
6 TypeCheckerTask(Compiler compiler) : super(compiler); 6 TypeCheckerTask(Compiler compiler) : super(compiler);
7 String get name() => "Type checker"; 7 String get name() => "Type checker";
8 8
9 static final bool LOG_FAILURES = false; 9 static final bool LOG_FAILURES = false;
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 toString() { 98 toString() {
99 StringBuffer sb = new StringBuffer(); 99 StringBuffer sb = new StringBuffer();
100 bool first = true; 100 bool first = true;
101 sb.add('('); 101 sb.add('(');
102 parameterTypes.printOn(sb, ', '); 102 parameterTypes.printOn(sb, ', ');
103 sb.add(') -> ${returnType}'); 103 sb.add(') -> ${returnType}');
104 return sb.toString(); 104 return sb.toString();
105 } 105 }
106 106
107 SourceString get name() => const SourceString('Function'); 107 SourceString get name() => const SourceString('Function');
108
109 int arity() {
ahe 2012/05/29 12:32:08 This method does not have the performance characte
ngeoffray 2012/05/29 13:06:28 Done.
110 int arity = 0;
111 parameterTypes.forEach((_) { arity++; });
112 return arity;
113 }
108 } 114 }
109 115
110 class Types { 116 class Types {
111 static final VOID = const SourceString('void'); 117 static final VOID = const SourceString('void');
112 static final INT = const SourceString('int'); 118 static final INT = const SourceString('int');
113 static final DOUBLE = const SourceString('double'); 119 static final DOUBLE = const SourceString('double');
114 static final DYNAMIC = const SourceString('Dynamic'); 120 static final DYNAMIC = const SourceString('Dynamic');
115 static final STRING = const SourceString('String'); 121 static final STRING = const SourceString('String');
116 static final BOOL = const SourceString('bool'); 122 static final BOOL = const SourceString('bool');
117 static final OBJECT = const SourceString('Object'); 123 static final OBJECT = const SourceString('Object');
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 780 }
775 781
776 visitCatchBlock(CatchBlock node) { 782 visitCatchBlock(CatchBlock node) {
777 return unhandledStatement(); 783 return unhandledStatement();
778 } 784 }
779 785
780 visitTypedef(Typedef node) { 786 visitTypedef(Typedef node) {
781 return unhandledStatement(); 787 return unhandledStatement();
782 } 788 }
783 } 789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698