mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
NameError#receiver of uninitialized constant
* error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a929727f6
commit
72ff61f4a8
11 changed files with 206 additions and 237 deletions
|
@ -671,6 +671,10 @@ end.join
|
|||
obj.instance_eval("Object")
|
||||
}
|
||||
assert_equal(:Object, e.name)
|
||||
e = assert_raise(NameError) {
|
||||
BasicObject::X
|
||||
}
|
||||
assert_same(BasicObject, e.receiver)
|
||||
e = assert_raise(NameError) {
|
||||
obj.instance_eval {foo}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue