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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/constants.dart

Issue 11419118: Change === to identical in the dart2js source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart2js; 5 part of dart2js;
6 6
7 abstract class ConstantVisitor<R> { 7 abstract class ConstantVisitor<R> {
8 R visitSentinel(SentinelConstant constant); 8 R visitSentinel(SentinelConstant constant);
9 R visitFunction(FunctionConstant constant); 9 R visitFunction(FunctionConstant constant);
10 R visitNull(NullConstant constant); 10 R visitNull(NullConstant constant);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 abstract class PrimitiveConstant extends Constant { 97 abstract class PrimitiveConstant extends Constant {
98 get value; 98 get value;
99 const PrimitiveConstant(); 99 const PrimitiveConstant();
100 bool isPrimitive() => true; 100 bool isPrimitive() => true;
101 101
102 bool operator ==(var other) { 102 bool operator ==(var other) {
103 if (other is !PrimitiveConstant) return false; 103 if (other is !PrimitiveConstant) return false;
104 PrimitiveConstant otherPrimitive = other; 104 PrimitiveConstant otherPrimitive = other;
105 // We use == instead of === so that DartStrings compare correctly. 105 // We use == instead of 'identical' so that DartStrings compare correctly.
106 return value == otherPrimitive.value; 106 return value == otherPrimitive.value;
107 } 107 }
108 108
109 String toString() => value.toString(); 109 String toString() => value.toString();
110 // Primitive constants don't have dependencies. 110 // Primitive constants don't have dependencies.
111 List<Constant> getDependencies() => const <Constant>[]; 111 List<Constant> getDependencies() => const <Constant>[];
112 DartString toDartString(); 112 DartString toDartString();
113 } 113 }
114 114
115 class NullConstant extends PrimitiveConstant { 115 class NullConstant extends PrimitiveConstant {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 for (int i = 0; i < fields.length; i++) { 464 for (int i = 0; i < fields.length; i++) {
465 if (fields[i] != other.fields[i]) return false; 465 if (fields[i] != other.fields[i]) return false;
466 } 466 }
467 return true; 467 return true;
468 } 468 }
469 469
470 List<Constant> getDependencies() => fields; 470 List<Constant> getDependencies() => fields;
471 471
472 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); 472 accept(ConstantVisitor visitor) => visitor.visitConstructed(this);
473 } 473 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698