summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-02-15 20:04:23 +0900
committerYusuke Endoh <[email protected]>2024-02-15 20:43:11 +0900
commita7718c914a216457ca9d3806085e673eabda8b31 ()
tree99f122f32afba7f5c8407c6ac3eecd2bebc1c364
parent0da12fa34e904603d2aa84e25924a3fde8a44f39 (diff)
Do not show an anonymous class as a receiver
-rw-r--r--test/ruby/test_backtrace.rb19
-rw-r--r--variable.c6
-rw-r--r--vm_backtrace.c11
3 files changed, 32 insertions, 4 deletions
@@ -428,4 +428,23 @@ class TestBacktrace < Test::Unit::TestCase
enum.next
end;
end
end
@@ -111,6 +111,12 @@ classname(VALUE klass, bool *permanent)
return classpath;
}
/*
* call-seq:
* mod.name -> string
@@ -191,22 +191,25 @@ location_lineno_m(VALUE self)
return INT2FIX(location_lineno(location_ptr(self)));
}
static VALUE
gen_method_name(VALUE owner, VALUE name)
{
if (RB_TYPE_P(owner, T_CLASS) || RB_TYPE_P(owner, T_MODULE)) {
if (RBASIC(owner)->flags & FL_SINGLETON) {
VALUE v = RCLASS_ATTACHED_OBJECT(owner);
if (RB_TYPE_P(v, T_CLASS) || RB_TYPE_P(v, T_MODULE)) {
- v = rb_class_path(v);
- if (!NIL_P(v)) {
return rb_sprintf("%"PRIsVALUE".%"PRIsVALUE, v, name);
}
}
}
else {
- owner = rb_class_path(owner);
- if (!NIL_P(owner)) {
return rb_sprintf("%"PRIsVALUE"#%"PRIsVALUE, owner, name);
}
}