Chromium Code Reviews| Index: pkg/unittest/lib/unittest.dart |
| =================================================================== |
| --- pkg/unittest/lib/unittest.dart (revision 26163) |
| +++ pkg/unittest/lib/unittest.dart (working copy) |
| @@ -850,10 +850,19 @@ |
| */ |
| bool formatStacks = true; |
| -/** Returns a Trace object from a StackTrace object or a String. */ |
| +/** |
| + * A flag that controls whether we try to filter out irrelevant frames from |
| + * the stack trce. Requires formatStacks to be set. |
| + */ |
| +bool filterStacks = true; |
| + |
| +/** |
| + * Returns a Trace object from a StackTrace object or a String, or the |
| + * unchanged input if formatStacks is false; |
| + */ |
|
nweiz
2013/08/14 23:56:59
This method is now typed incorrectly. See my comme
gram
2013/08/15 22:36:43
Done.
|
| Trace _getTrace(stack) { |
| Trace trace; |
| - if (stack == null) return null; |
| + if (stack == null || !formatStacks) return stack; |
| if (stack is String) { |
| trace = new Trace.parse(stack); |
| } else if (stack is StackTrace) { |
| @@ -862,7 +871,7 @@ |
| throw new Exception('Invalid stack type ${stack.runtimeType} for $stack.'); |
| } |
| - if (!formatStacks) return trace; |
| + if (!filterStacks) return trace; |
| // Format the stack trace by removing everything above TestCase._runTest, |
| // which is usually going to be irrelevant. Also fold together unittest and |