This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 1.6.6
2+
3+ * ` new Trace.current() ` and ` new Chain.current() ` now skip an extra frame when
4+ run in a JS context. This makes their return values match the VM context.
5+
16## 1.6.5
27
38* Really fix strong mode warnings.
Original file line number Diff line number Diff line change @@ -81,7 +81,11 @@ class Trace implements StackTrace {
8181 }
8282
8383 var trace = new Trace .from (StackTrace .current);
84- return new LazyTrace (() => new Trace (trace.frames.skip (level + 1 )));
84+ return new LazyTrace (() {
85+ // JS includes a frame for the call to StackTrace.current, but the VM
86+ // doesn't, so we skip an extra frame in a JS context.
87+ return new Trace (trace.frames.skip (level + (inJS ? 2 : 1 )));
88+ });
8589 }
8690
8791 /// Returns a new stack trace containing the same data as [trace] .
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'package:path/path.dart' as p;
6+
57/// The line used in the string representation of stack chains to represent
68/// the gap between traces.
79const chainGap = '===== asynchronous gap ===========================\n ' ;
810
11+ // TODO(nweiz): When cross-platform imports work, use them to set this.
12+ /// Whether we're running in a JS context.
13+ final bool inJS = p.style == p.Style .url;
14+
915/// Returns [string] with enough spaces added to the end to make it [length]
1016/// characters long.
1117String padRight (String string, int length) {
Original file line number Diff line number Diff 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.6-dev
10+ version : 1.6.6
1111author : " Dart Team <misc@dartlang.org>"
1212homepage : https://github.com/dart-lang/stack_trace
1313description : >
You can’t perform that action at this time.
0 commit comments