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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1152063004: Use artificial hashCode values. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.constant; 8 library engine.constant;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // which case we skip it. 363 // which case we skip it.
364 if (elementAnnotation != null) { 364 if (elementAnnotation != null) {
365 Element element = elementAnnotation.element; 365 Element element = elementAnnotation.element;
366 if (element is PropertyAccessorElement && 366 if (element is PropertyAccessorElement &&
367 element.variable is VariableElementImpl) { 367 element.variable is VariableElementImpl) {
368 // The annotation is a reference to a compile-time constant variable. 368 // The annotation is a reference to a compile-time constant variable.
369 // Just copy the evaluation result. 369 // Just copy the evaluation result.
370 VariableElementImpl variableElement = 370 VariableElementImpl variableElement =
371 element.variable as VariableElementImpl; 371 element.variable as VariableElementImpl;
372 elementAnnotation.evaluationResult = variableElement.evaluationResult; 372 elementAnnotation.evaluationResult = variableElement.evaluationResult;
373 } else if (element is ConstructorElementImpl && element.isConst && 373 } else if (element is ConstructorElementImpl &&
374 element.isConst &&
374 constNode.arguments != null) { 375 constNode.arguments != null) {
375 RecordingErrorListener errorListener = new RecordingErrorListener(); 376 RecordingErrorListener errorListener = new RecordingErrorListener();
376 CompilationUnit sourceCompilationUnit = 377 CompilationUnit sourceCompilationUnit =
377 constNode.getAncestor((node) => node is CompilationUnit); 378 constNode.getAncestor((node) => node is CompilationUnit);
378 ErrorReporter errorReporter = new ErrorReporter( 379 ErrorReporter errorReporter = new ErrorReporter(
379 errorListener, sourceCompilationUnit.element.source); 380 errorListener, sourceCompilationUnit.element.source);
380 ConstantVisitor constantVisitor = 381 ConstantVisitor constantVisitor =
381 new ConstantVisitor(this, errorReporter); 382 new ConstantVisitor(this, errorReporter);
382 DartObjectImpl result = evaluateConstructorCall(constNode, 383 DartObjectImpl result = evaluateConstructorCall(constNode,
383 constNode.arguments.arguments, element, constantVisitor, 384 constNode.arguments.arguments, element, constantVisitor,
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 class ConstantEvaluationTarget_Annotation implements ConstantEvaluationTarget { 934 class ConstantEvaluationTarget_Annotation implements ConstantEvaluationTarget {
934 final AnalysisContext context; 935 final AnalysisContext context;
935 final Source source; 936 final Source source;
936 final Source librarySource; 937 final Source librarySource;
937 final Annotation annotation; 938 final Annotation annotation;
938 939
939 ConstantEvaluationTarget_Annotation( 940 ConstantEvaluationTarget_Annotation(
940 this.context, this.source, this.librarySource, this.annotation); 941 this.context, this.source, this.librarySource, this.annotation);
941 942
942 @override 943 @override
943 int get hashCode => JenkinsSmiHash.hash4(context.hashCode, source.hashCode, 944 int get hashCode => JenkinsSmiHash.hash3(
944 librarySource.hashCode, annotation.hashCode); 945 source.hashCode, librarySource.hashCode, annotation.hashCode);
945 946
946 @override 947 @override
947 bool operator ==(other) { 948 bool operator ==(other) {
948 if (other is ConstantEvaluationTarget_Annotation) { 949 if (other is ConstantEvaluationTarget_Annotation) {
949 return this.context == other.context && 950 return this.context == other.context &&
950 this.source == other.source && 951 this.source == other.source &&
951 this.librarySource == other.librarySource && 952 this.librarySource == other.librarySource &&
952 this.annotation == other.annotation; 953 this.annotation == other.annotation;
953 } else { 954 } else {
954 return false; 955 return false;
(...skipping 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after
5216 return BoolState.from(_element == rightElement); 5217 return BoolState.from(_element == rightElement);
5217 } else if (rightOperand is DynamicState) { 5218 } else if (rightOperand is DynamicState) {
5218 return BoolState.UNKNOWN_VALUE; 5219 return BoolState.UNKNOWN_VALUE;
5219 } 5220 }
5220 return BoolState.FALSE_STATE; 5221 return BoolState.FALSE_STATE;
5221 } 5222 }
5222 5223
5223 @override 5224 @override
5224 String toString() => _element == null ? "-unknown-" : _element.name; 5225 String toString() => _element == null ? "-unknown-" : _element.name;
5225 } 5226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698