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

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

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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 library universe; 5 library universe;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../dart2jslib.dart'; 9 import '../dart2jslib.dart';
10 import '../runtime_types.dart'; 10 import '../runtime_types.dart';
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1; 207 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1;
208 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2 ; 208 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2 ;
209 209
210 bool isOperator() => identical(kind, SelectorKind.OPERATOR); 210 bool isOperator() => identical(kind, SelectorKind.OPERATOR);
211 bool isUnaryOperator() => isOperator() && argumentCount == 0; 211 bool isUnaryOperator() => isOperator() && argumentCount == 0;
212 bool isBinaryOperator() => isOperator() && argumentCount == 1; 212 bool isBinaryOperator() => isOperator() && argumentCount == 1;
213 213
214 /** Check whether this is a call to 'assert'. */ 214 /** Check whether this is a call to 'assert'. */
215 bool isAssert() => isCall() && identical(name.stringValue, "assert"); 215 bool isAssert() => isCall() && identical(name.stringValue, "assert");
216 216
217 int hashCode() => argumentCount + 1000 * namedArguments.length; 217 int get hashCode => argumentCount + 1000 * namedArguments.length;
218 int get namedArgumentCount => namedArguments.length; 218 int get namedArgumentCount => namedArguments.length;
219 int get positionalArgumentCount => argumentCount - namedArgumentCount; 219 int get positionalArgumentCount => argumentCount - namedArgumentCount;
220 DartType get receiverType => null; 220 DartType get receiverType => null;
221 221
222 bool applies(Element element, Compiler compiler) 222 bool applies(Element element, Compiler compiler)
223 => appliesUntyped(element, compiler); 223 => appliesUntyped(element, compiler);
224 224
225 bool appliesUntyped(Element element, Compiler compiler) { 225 bool appliesUntyped(Element element, Compiler compiler) {
226 if (element.isSetter()) return isSetter(); 226 if (element.isSetter()) return isSetter();
227 if (element.isGetter()) return isGetter() || isCall(); 227 if (element.isGetter()) return isGetter() || isCall();
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 529
530 if (!self.isInterface() && self.isSubclassOf(other)) { 530 if (!self.isInterface() && self.isSubclassOf(other)) {
531 // Resolve an invocation of [element.name] on [self]. If it 531 // Resolve an invocation of [element.name] on [self]. If it
532 // is found, this selector is a candidate. 532 // is found, this selector is a candidate.
533 return hasElementIn(self, element) && appliesUntyped(element, compiler); 533 return hasElementIn(self, element) && appliesUntyped(element, compiler);
534 } 534 }
535 535
536 return false; 536 return false;
537 } 537 }
538 } 538 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698