class.c (mrb_method_missing): add receiver's class to clarify

We needed to modify a lot of test code that expected the old style.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-11-12 06:37:03 +09:00
parent 13acf12df5
commit 65e0e5bbd3
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -54,5 +54,5 @@ a = 5
A.call
TESTCODE
assert_kind_of Integer, o =~ /\bundefined method 'a' \(NoMethodError\).*=> 5\b.*=> 1\b/m
assert_kind_of Integer, o =~ /\bundefined method 'a' .*\(NoMethodError\).*=> 5\b.*=> 1\b/m
end
+2 -2
View File
@@ -166,8 +166,8 @@ assert('top level local variables are in file scope') do
system "#{cmd('mrbc')} -g -o #{amrb.path} #{arb.path}"
File.write brb.path, 'p a'
system "#{cmd('mrbc')} -g -o #{bmrb.path} #{brb.path}"
assert_mruby("", /:1: undefined method 'a' \(NoMethodError\)\n\z/, false, ["-r", arb.path, brb.path])
assert_mruby("", /:1: undefined method 'a' \(NoMethodError\)\n\z/, false, ["-b", "-r", amrb.path, bmrb.path])
assert_mruby("", /:1: undefined method 'a' .*\(NoMethodError\)\n\z/, false, ["-r", arb.path, brb.path])
assert_mruby("", /:1: undefined method 'a' .*\(NoMethodError\)\n\z/, false, ["-b", "-r", amrb.path, bmrb.path])
File.write crb.path, 'a, b, c = 1, 2, 3; A = -> { b = -2; [a, b, c] }'
system "#{cmd('mrbc')} -g -o #{cmrb.path} #{crb.path}"
+1 -1
View File
@@ -2844,7 +2844,7 @@ mrb_value mrb_obj_id_m(mrb_state *mrb, mrb_value self);
mrb_noreturn void
mrb_method_missing(mrb_state *mrb, mrb_sym name, mrb_value self, mrb_value args)
{
mrb_no_method_error(mrb, name, args, "undefined method '%n'", name);
mrb_no_method_error(mrb, name, args, "undefined method '%n' for %T", name, self);
}
/* 15.3.1.3.30 */
+1 -1
View File
@@ -352,7 +352,7 @@ assert('Kernel#method_missing', '15.3.1.3.30') do
end
a = String.new
msg = "undefined method 'no_method_named_this'"
msg = "undefined method 'no_method_named_this' for String"
assert_raise_with_message(NoMethodError, msg) do
a.no_method_named_this
end