ruby/ruby — pull request #431 by lightpriest (2013-10-27 18:16:12+00:00)
Title: Remove NameError#to_s override

NameError#to_s presented an inconsistent behavior with other *Error classes:

> StandardError.new("foo") # =>
> StandardError.new(String) # =>
> NameError.new("foo") # =>
> NameError.new(String) # => Exception: `to_s': can't convert Class into String
(TypeError)

Although Kernel#raise specifically states a "string" in the doc, it does accept
any instance that has #to_s. The exception that is raised for
NameError.new(String) makes this behavior inconsistent.

This patch removes the specific name_err_to_s(). Comparing to exc_to_s() it
seems like the only difference between them is the usage of StringValue(exc)
instead of rb_String(exc).