Fix all strong mode warnings.
R=tjblasi@google.com
Review URL: https://codereview.chromium.org//1830053002 .
diff --git a/.analysis_options b/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+ strong-mode: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66c1108..8ed5060 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
+## 1.6.2
+
+* Fix all strong mode warnings.
+
## 1.6.1
-* Use `StacktTrace.current` in Dart SDK 1.14 to get the current stack trace.
+* Use `StackTrace.current` in Dart SDK 1.14 to get the current stack trace.
## 1.6.0
diff --git a/lib/src/chain.dart b/lib/src/chain.dart
index c282387..b6f36d2 100644
--- a/lib/src/chain.dart
+++ b/lib/src/chain.dart
@@ -193,7 +193,7 @@
///
/// The trace version of a chain is just the concatenation of all the traces
/// in the chain.
- Trace toTrace() => new Trace(flatten(traces.map((trace) => trace.frames)));
+ Trace toTrace() => new Trace(traces.expand((trace) => trace.frames));
String toString() {
// Figure out the longest path so we know how much to pad.
diff --git a/lib/src/trace.dart b/lib/src/trace.dart
index 927a167..0a7f320 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -257,7 +257,7 @@
};
}
- var newFrames = [];
+ var newFrames = <Frame>[];
for (var frame in frames.reversed) {
if (frame is UnparsedFrame || !predicate(frame)) {
newFrames.add(frame);
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 5781d5f..710abdc 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -19,20 +19,3 @@
return result.toString();
}
-
-/// Flattens nested lists inside an iterable into a single list containing only
-/// non-list elements.
-List flatten(Iterable nested) {
- var result = [];
- helper(list) {
- for (var element in list) {
- if (element is List) {
- helper(element);
- } else {
- result.add(element);
- }
- }
- }
- helper(nested);
- return result;
-}
diff --git a/pubspec.yaml b/pubspec.yaml
index 1c180cf..465011b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -7,7 +7,7 @@
#
# When the major version is upgraded, you *must* update that version constraint
# in pub to stay in sync with this.
-version: 1.6.2-dev
+version: 1.6.2
author: "Dart Team <misc@dartlang.org>"
homepage: http://github.com/dart-lang/stack_trace
description: >