Backport #8884
closed`caller(1, nil)` raises a runtime error while its reference says its signature as `caller(start=1, length=nil)`
Description
$ ruby -e 'caller(1, nil)'
-e:1:incaller': 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 11 years ago
- 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 nobu (Nobuyoshi Nakada) about 11 years ago
Seems fine.
Updated by sorah (Sorah Fukumori) about 11 years ago
- 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 11 years ago
- 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 11 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport200
- 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 11 years ago
- 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.