Environment Information
Provide at least:
- JRuby: 10.1.0.0
- OS: Linux
Expected Behavior
MRI 4.0 and JRuby 10.1 return the same number of lines when caller is called.
I know it might fall under "Stack Trace Differences" mentioned in Differences Between MRI and JRuby. If that's expected difference, just let me know.
Between Ruby 3.4 and 4.0 there was a change in what is returned from caller when it's invoked inside initialize.
With this reproduction script (caller.rb):
class Inner
def initialize
puts caller
end
end
class Outer
def call
Inner.new
end
end
Outer.new.call
On Ruby 3.4:
caller.rb:9:in 'Class#new'
caller.rb:9:in 'Outer#call'
caller.rb:13:in '<main>'
On Ruby 4.0:
caller.rb:9:in 'Outer#call'
caller.rb:13:in '<main>'
Actual Behavior
On JRuby 10.1.0.0:
caller.rb:9:in 'new'
caller.rb:9:in 'call'
caller.rb:13:in '<main>'
(same as in 10.0.5.0)
So it's actually the opposite to this part in wiki:
The "new" frame from constructing an object may not be present due to optimizations.
"new" frame is actually present in JRuby, but not in MRI.
Environment Information
Provide at least:
Expected Behavior
MRI 4.0 and JRuby 10.1 return the same number of lines when
calleris called.I know it might fall under "Stack Trace Differences" mentioned in Differences Between MRI and JRuby. If that's expected difference, just let me know.
Between Ruby 3.4 and 4.0 there was a change in what is returned from
callerwhen it's invoked insideinitialize.With this reproduction script (
caller.rb):On Ruby 3.4:
On Ruby 4.0:
Actual Behavior
On JRuby 10.1.0.0:
(same as in 10.0.5.0)
So it's actually the opposite to this part in wiki:
"new" frame is actually present in JRuby, but not in MRI.