| 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 dart2js.constants.expressions; | 5 library dart2js.constants.expressions; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../common_elements.dart'; | 9 import '../common_elements.dart'; |
| 10 import '../elements/entities.dart'; | 10 import '../elements/entities.dart'; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return sb.toString(); | 91 return sb.toString(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 /// Writes the structure of the constant into [sb]. | 94 /// Writes the structure of the constant into [sb]. |
| 95 void _createStructuredText(StringBuffer sb); | 95 void _createStructuredText(StringBuffer sb); |
| 96 | 96 |
| 97 int _computeHashCode(); | 97 int _computeHashCode(); |
| 98 | 98 |
| 99 int get hashCode => _hashCode ??= _computeHashCode(); | 99 int get hashCode => _hashCode ??= _computeHashCode(); |
| 100 | 100 |
| 101 bool _equals(ConstantExpression other); | 101 bool _equals(covariant ConstantExpression other); |
| 102 | 102 |
| 103 bool operator ==(other) { | 103 bool operator ==(other) { |
| 104 if (identical(this, other)) return true; | 104 if (identical(this, other)) return true; |
| 105 if (other is! ConstantExpression) return false; | 105 if (other is! ConstantExpression) return false; |
| 106 if (kind != other.kind) return false; | 106 if (kind != other.kind) return false; |
| 107 if (hashCode != other.hashCode) return false; | 107 if (hashCode != other.hashCode) return false; |
| 108 return _equals(other); | 108 return _equals(other); |
| 109 } | 109 } |
| 110 | 110 |
| 111 String toString() { | 111 String toString() { |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 visit(exp.name); | 1927 visit(exp.name); |
| 1928 if (exp.defaultValue != null) { | 1928 if (exp.defaultValue != null) { |
| 1929 sb.write(', defaultValue: '); | 1929 sb.write(', defaultValue: '); |
| 1930 visit(exp.defaultValue); | 1930 visit(exp.defaultValue); |
| 1931 } | 1931 } |
| 1932 sb.write(')'); | 1932 sb.write(')'); |
| 1933 } | 1933 } |
| 1934 | 1934 |
| 1935 String toString() => sb.toString(); | 1935 String toString() => sb.toString(); |
| 1936 } | 1936 } |
| OLD | NEW |