Skip to content

Commit a56a284

Browse files
authored
Document that terse doesn't work with JS traces. (flutter#15)
Closes flutter#14
1 parent dfb94f3 commit a56a284

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.6.8
2+
3+
* Add a note to the documentation of `Chain.terse` and `Trace.terse`.
4+
15
## 1.6.7
26

37
* Fix a bug where `new Frame.caller()` returned the wrong depth of frame on

lib/src/chain.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ class Chain implements StackTrace {
150150
///
151151
/// This calls [Trace.terse] on every trace in [traces], and discards any
152152
/// trace that contain only internal frames.
153+
///
154+
/// This won't do anything with a raw JavaScript trace, since there's no way
155+
/// to determine which frames come from which Dart libraries. However, the
156+
/// [`source_map_stack_trace`][source_map_stack_trace] package can be used to
157+
/// convert JavaScript traces into Dart-style traces.
158+
///
159+
/// [source_map_stack_trace]: https://pub.dartlang.org/packages/source_map_stack_trace
153160
Chain get terse => foldFrames((_) => false, terse: true);
154161

155162
/// Returns a new [Chain] based on [this] where multiple stack frames matching

lib/src/trace.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ class Trace implements StackTrace {
225225
/// removed. If the outermost frame of the stack trace is a core library
226226
/// frame, it's removed entirely.
227227
///
228+
/// This won't do anything with a raw JavaScript trace, since there's no way
229+
/// to determine which frames come from which Dart libraries. However, the
230+
/// [`source_map_stack_trace`][source_map_stack_trace] package can be used to
231+
/// convert JavaScript traces into Dart-style traces.
232+
///
233+
/// [source_map_stack_trace]: https://pub.dartlang.org/packages/source_map_stack_trace
234+
///
228235
/// For custom folding, see [foldFrames].
229236
Trace get terse => foldFrames((_) => false, terse: true);
230237

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: stack_trace
77
#
88
# When the major version is upgraded, you *must* update that version constraint
99
# in pub to stay in sync with this.
10-
version: 1.6.8-dev
10+
version: 1.6.8
1111
author: "Dart Team <[email protected]>"
1212
homepage: https://github.com/dart-lang/stack_trace
1313
description: >

0 commit comments

Comments
 (0)