File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -287,15 +287,14 @@ location_label(rb_backtrace_location_t *loc)
287
287
* 1.times do
288
288
* puts caller_locations(0).first.label
289
289
* end
290
- *
291
290
* end
292
291
* end
293
292
*
294
293
* The result of calling +foo+ is this:
295
294
*
296
- * label: foo
297
- * label: block in foo
298
- * label: block (2 levels) in foo
295
+ * foo
296
+ * block in foo
297
+ * block (2 levels) in foo
299
298
*
300
299
*/
301
300
static VALUE
@@ -315,10 +314,28 @@ location_base_label(rb_backtrace_location_t *loc)
315
314
}
316
315
317
316
/*
318
- * Returns the label of this frame without decoration.
317
+ * Returns the base label of this frame, which is usually equal to the label,
318
+ * without decoration.
319
+ *
320
+ * Consider the following example:
321
+ *
322
+ * def foo
323
+ * puts caller_locations(0).first.base_label
324
+ *
325
+ * 1.times do
326
+ * puts caller_locations(0).first.base_label
327
+ *
328
+ * 1.times do
329
+ * puts caller_locations(0).first.base_label
330
+ * end
331
+ * end
332
+ * end
333
+ *
334
+ * The result of calling +foo+ is this:
319
335
*
320
- * For example, if the label is `foo`, this method returns `foo` as well, but if
321
- * the label is +rescue in foo+, this method returns just +foo+.
336
+ * foo
337
+ * foo
338
+ * foo
322
339
*/
323
340
static VALUE
324
341
location_base_label_m (VALUE self )
You can’t perform that action at this time.
0 commit comments