OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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.util; | 5 library dart2js.util; |
6 | 6 |
7 import "dart:collection"; | 7 import "dart:collection"; |
8 import 'util_implementation.dart'; | 8 import 'util_implementation.dart'; |
9 import 'characters.dart'; | 9 import 'characters.dart'; |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 const Spannable CURRENT_ELEMENT_SPANNABLE = | 32 const Spannable CURRENT_ELEMENT_SPANNABLE = |
33 const _SpannableSentinel("Current element"); | 33 const _SpannableSentinel("Current element"); |
34 | 34 |
35 class SpannableAssertionFailure { | 35 class SpannableAssertionFailure { |
36 final Spannable node; | 36 final Spannable node; |
37 final String message; | 37 final String message; |
38 SpannableAssertionFailure(this.node, this.message); | 38 SpannableAssertionFailure(this.node, this.message); |
39 | 39 |
40 String toString() => 'Compiler crashed: $message'; | 40 String toString() => 'Assertion failure: $message'; |
41 } | 41 } |
42 | 42 |
43 /** | 43 /** |
44 * Helper method for printing stack traces for debugging. | 44 * Helper method for printing stack traces for debugging. |
45 * | 45 * |
46 * [message] is printed as the header of the stack trace. | 46 * [message] is printed as the header of the stack trace. |
47 * | 47 * |
48 * If [condition] is provided, the stack trace is only printed if [condition] | 48 * If [condition] is provided, the stack trace is only printed if [condition] |
49 * returns [:true:] on the stack trace text. This can be used to filter the | 49 * returns [:true:] on the stack trace text. This can be used to filter the |
50 * printed stack traces based on their content. For instance only print stack | 50 * printed stack traces based on their content. For instance only print stack |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 283 } |
284 buffer.write(string); | 284 buffer.write(string); |
285 } | 285 } |
286 | 286 |
287 int computeHashCode(part1, [part2, part3, part4]) { | 287 int computeHashCode(part1, [part2, part3, part4]) { |
288 return (part1.hashCode | 288 return (part1.hashCode |
289 ^ part2.hashCode | 289 ^ part2.hashCode |
290 ^ part3.hashCode | 290 ^ part3.hashCode |
291 ^ part4.hashCode) & 0x3fffffff; | 291 ^ part4.hashCode) & 0x3fffffff; |
292 } | 292 } |
OLD | NEW |