Revert "Remove workaround for truncated last lines (#100)" (#104)
This reverts commit c252c7b63f16b8f561486d27e2bd0679f5fe3ff8.
diff --git a/lib/src/trace.dart b/lib/src/trace.dart
index e51d4b4..42371c7 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -151,7 +151,22 @@
.replaceAll(vmChainGap, '')
.split('\n')
.where((line) => line.isNotEmpty);
- return [for (var line in lines) Frame.parseVM(line)];
+
+ if (lines.isEmpty) {
+ return [];
+ }
+
+ var frames = lines
+ .take(lines.length - 1)
+ .map((line) => Frame.parseVM(line))
+ .toList();
+
+ // TODO(nweiz): Remove this when issue 23614 is fixed.
+ if (!lines.last.endsWith('.da')) {
+ frames.add(Frame.parseVM(lines.last));
+ }
+
+ return frames;
}
/// Parses a string representation of a Chrome/V8 stack trace.