Skip to content

Commit c1c1c8e

Browse files
committed
use Kernel.__callee__
for BasicObject fix #1152
1 parent 24f95d6 commit c1c1c8e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/debug/thread_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def initialize
13101310
frame._local_variables = b.local_variables.map{|name|
13111311
[name, b.local_variable_get(name)]
13121312
}.to_h
1313-
frame._callee = b.eval('__callee__')
1313+
frame._callee = b.eval('::Kernel.__callee__')
13141314
end
13151315
}
13161316
append(frames)

test/console/record_test.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,24 @@ def test_1663647719
315315
end
316316
end
317317
end
318+
319+
class RecordOnBasicClassTest < ConsoleTestCase
320+
def program
321+
<<~RUBY
322+
1| class Test < BasicObject
323+
2| def test
324+
3| 42
325+
4| end
326+
5| end
327+
6| Test.new.test
328+
RUBY
329+
end
330+
331+
def test_issue1152
332+
debug_code program do
333+
type 'record on'
334+
type 'c'
335+
end
336+
end
337+
end
318338
end

0 commit comments

Comments
 (0)