| OLD | NEW |
| 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 library deferred_load; | 5 library deferred_load; |
| 6 | 6 |
| 7 import 'common/tasks.dart' show CompilerTask; | 7 import 'common/tasks.dart' show CompilerTask; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'compiler.dart' show Compiler; | 9 import 'compiler.dart' show Compiler; |
| 10 import 'constants/expressions.dart' show ConstantExpression; | 10 import 'constants/expressions.dart' show ConstantExpression; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 /// `true` if this output unit is for the main output file. | 63 /// `true` if this output unit is for the main output file. |
| 64 final bool isMainOutput; | 64 final bool isMainOutput; |
| 65 | 65 |
| 66 /// A unique name representing this [OutputUnit]. | 66 /// A unique name representing this [OutputUnit]. |
| 67 String name; | 67 String name; |
| 68 | 68 |
| 69 OutputUnit({this.isMainOutput: false}); | 69 OutputUnit({this.isMainOutput: false}); |
| 70 | 70 |
| 71 String toString() => "OutputUnit($name)"; | 71 String toString() => "OutputUnit($name)"; |
| 72 | 72 |
| 73 bool operator ==(OutputUnit other) { | 73 bool operator ==(other) { |
| 74 return imports.length == other.imports.length && | 74 return other is OutputUnit && |
| 75 imports.length == other.imports.length && |
| 75 imports.containsAll(other.imports); | 76 imports.containsAll(other.imports); |
| 76 } | 77 } |
| 77 | 78 |
| 78 int get hashCode { | 79 int get hashCode { |
| 79 int sum = 0; | 80 int sum = 0; |
| 80 for (_DeferredImport import in imports) { | 81 for (_DeferredImport import in imports) { |
| 81 sum = (sum + import.hashCode) & 0x3FFFFFFF; // Stay in 30 bit range. | 82 sum = (sum + import.hashCode) & 0x3FFFFFFF; // Stay in 30 bit range. |
| 82 } | 83 } |
| 83 return sum; | 84 return sum; |
| 84 } | 85 } |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 | 1103 |
| 1103 bool operator ==(other) { | 1104 bool operator ==(other) { |
| 1104 if (other is! _DeclaredDeferredImport) return false; | 1105 if (other is! _DeclaredDeferredImport) return false; |
| 1105 return declaration == other.declaration; | 1106 return declaration == other.declaration; |
| 1106 } | 1107 } |
| 1107 | 1108 |
| 1108 int get hashCode => declaration.hashCode * 17; | 1109 int get hashCode => declaration.hashCode * 17; |
| 1109 | 1110 |
| 1110 String toString() => '$declaration'; | 1111 String toString() => '$declaration'; |
| 1111 } | 1112 } |
| OLD | NEW |