Project

General

Profile

This project is closed and read-only.

Actions

Backport #8884

closed

`caller(1, nil)` raises a runtime error while its reference says its signature as `caller(start=1, length=nil)`

Backport #8884: `caller(1, nil)` raises a runtime error while its reference says its signature as `caller(start=1, length=nil)`

Added by gfx (Goro FUJI) about 13 years ago. Updated about 13 years ago.


Description

$ ruby -e 'caller(1, nil)'
-e:1:in caller': no implicit conversion from nil to integer (TypeError) from -e:1:in

'

Either the behaviour or the document looks wrong; I don't know which is wrong, though.

Updated by sorah (Sorah Fukumori) about 13 years ago Actions #1 [ruby-core:57095]

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

This patch fixes: https://gist.github.com/sorah/6503895

I'll commit this if doc is correct.

Updated by sorah (Sorah Fukumori) about 13 years ago Actions #3

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42905.
Goro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
    it is nil. [Bug #8884] [ruby-core:57094]

  • test/ruby/test_backtrace.rb (test_caller_with_nil_length):
    Test for above.

Updated by sorah (Sorah Fukumori) about 13 years ago Actions #4 [ruby-core:57101]

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: UNKNOWN, 2.0.0: REQUIRED

documentation on 2.0.0 is same, so flagging as backport onto 2.0.0 needed.

Updated by nagachika (Tomoyuki Chikanaga) about 13 years ago Actions #5

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 15
  • Status changed from Closed to Assigned
  • Assignee changed from ko1 (Koichi Sasada) to nagachika (Tomoyuki Chikanaga)

On 1.9.3, Kernel#caller has only one argument.
I will move this ticket to Backport 200.

Updated by nagachika (Tomoyuki Chikanaga) about 13 years ago Actions #6

  • Status changed from Assigned to Closed

This issue was solved with changeset r42925.
Goro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42905: [Backport #8884]

* vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
  it is nil. [Bug #8884] [ruby-core:57094]

* test/ruby/test_backtrace.rb (test_caller_with_nil_length):
  Test for above.
Actions

Also available in: PDF Atom