Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 2199ed3

Browse files
committed
Fix all strong mode warnings.
[email protected] Review URL: https://codereview.chromium.org//1830053002 .
1 parent f1e4143 commit 2199ed3

File tree

6 files changed

+10
-21
lines changed

6 files changed

+10
-21
lines changed

.analysis_options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
analyzer:
2+
strong-mode: true

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
## 1.6.2
2+
3+
* Fix all strong mode warnings.
4+
15
## 1.6.1
26

3-
* Use `StacktTrace.current` in Dart SDK 1.14 to get the current stack trace.
7+
* Use `StackTrace.current` in Dart SDK 1.14 to get the current stack trace.
48

59
## 1.6.0
610

lib/src/chain.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class Chain implements StackTrace {
193193
///
194194
/// The trace version of a chain is just the concatenation of all the traces
195195
/// in the chain.
196-
Trace toTrace() => new Trace(flatten(traces.map((trace) => trace.frames)));
196+
Trace toTrace() => new Trace(traces.expand((trace) => trace.frames));
197197

198198
String toString() {
199199
// Figure out the longest path so we know how much to pad.

lib/src/trace.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class Trace implements StackTrace {
257257
};
258258
}
259259

260-
var newFrames = [];
260+
var newFrames = <Frame>[];
261261
for (var frame in frames.reversed) {
262262
if (frame is UnparsedFrame || !predicate(frame)) {
263263
newFrames.add(frame);

lib/src/utils.dart

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,3 @@ String padRight(String string, int length) {
1919

2020
return result.toString();
2121
}
22-
23-
/// Flattens nested lists inside an iterable into a single list containing only
24-
/// non-list elements.
25-
List flatten(Iterable nested) {
26-
var result = [];
27-
helper(list) {
28-
for (var element in list) {
29-
if (element is List) {
30-
helper(element);
31-
} else {
32-
result.add(element);
33-
}
34-
}
35-
}
36-
helper(nested);
37-
return result;
38-
}

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.2-dev
10+
version: 1.6.2
1111
author: "Dart Team <[email protected]>"
1212
homepage: http://github.com/dart-lang/stack_trace
1313
description: >

0 commit comments

Comments
 (0)