OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 stack_trace.src.utils; | |
6 | |
7 /// The line used in the string representation of stack chains to represent | 5 /// The line used in the string representation of stack chains to represent |
8 /// the gap between traces. | 6 /// the gap between traces. |
9 const chainGap = '===== asynchronous gap ===========================\n'; | 7 const chainGap = '===== asynchronous gap ===========================\n'; |
10 | 8 |
11 /// Returns [string] with enough spaces added to the end to make it [length] | 9 /// Returns [string] with enough spaces added to the end to make it [length] |
12 /// characters long. | 10 /// characters long. |
13 String padRight(String string, int length) { | 11 String padRight(String string, int length) { |
14 if (string.length >= length) return string; | 12 if (string.length >= length) return string; |
15 | 13 |
16 var result = new StringBuffer(); | 14 var result = new StringBuffer(); |
(...skipping 14 matching lines...) Expand all Loading... |
31 if (element is List) { | 29 if (element is List) { |
32 helper(element); | 30 helper(element); |
33 } else { | 31 } else { |
34 result.add(element); | 32 result.add(element); |
35 } | 33 } |
36 } | 34 } |
37 } | 35 } |
38 helper(nested); | 36 helper(nested); |
39 return result; | 37 return result; |
40 } | 38 } |
OLD | NEW |