@@ -24,13 +24,6 @@ if ($!) {
24
24
This will print the last dataframe in the list, pointing at the line where it's
25
25
happened.
26
26
27
- = for code
28
- sub zipi { { { die "Something bad happened" }() }() };
29
- try zipi;
30
- say $!.backtrace.nice( :oneline ) if $! │
31
- # OUTPUT: « in sub zipi at /tmp/Ik2MevkgP1 line 1»
32
-
33
-
34
27
= head1 Methods
35
28
36
29
= head2 method new
@@ -73,6 +66,23 @@ the implementation, also some routines from the setting.
73
66
my $backtrace = Backtrace.new;
74
67
say $backtrace.Str;
75
68
69
+ = head2 method next-interesting-index
70
+
71
+ Defined as:
72
+
73
+ method next-interesting-index(Backtrace:D: Int $idx = 0, :$named, :$noproto, :$setting)
74
+
75
+ Returns the index of the next C < interesting > frame, once hidden and other
76
+ settings are taken into account. C < $named > will decide whether to printed only
77
+ those with a name, C < $noproto > will hide C < proto > s, and C < $setting > will hide
78
+ those are considered setting.
79
+
80
+ = for code
81
+ sub zipi { { { die "Something bad happened" }() }() };
82
+ try zipi;
83
+ say $!.backtrace.next-interesting-index; # OUTPUT: «2»
84
+ say $!.backtrace.next-interesting-index( :named ); # OUTPUT: «4»
85
+
76
86
= head2 method nice
77
87
78
88
Defined as:
@@ -82,6 +92,13 @@ Defined as:
82
92
Returns the backtrace as a list of I < interesting > frames. If C < :$oneline > is
83
93
set, will stop after the first frame.
84
94
95
+ = for code
96
+ sub zipi { { { die "Something bad happened" }() }() };
97
+ try zipi;
98
+ say $!.backtrace.nice( :oneline ) if $! │
99
+ # OUTPUT: « in sub zipi at /tmp/Ik2MevkgP1 line 1»
100
+
101
+
85
102
= head2 method full
86
103
87
104
Defined as:
0 commit comments