Bug #7574

名前についてのエラーメッセージが正しくない事がある

Added by tadayoshi funaba over 1 year ago. Updated over 1 year ago.

[ruby-dev:46749]
Status:Closed
Priority:Low
Assignee:Nobuyoshi Nakada
Category:core
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux] Backport:

Description

名前についてのエラーメッセージが正しくない事がある。

$ ruby -v -e 'instancevariableget("@foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in instance_variable_get':@foo' is not allowed as an instance variable name (NameError)

$ ruby -v -e 'Object.classvariableget("@@foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in class_variable_get':@@foo' is not allowed as a class variable name (NameError)

$ ruby -v -e 'Object.constset("FOO\000", 9)'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `const
set': wrong constant name FOO (NameError)

$ ruby -v -e 'Object.constget("FOO\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `const
get': uninitialized constant FOO (NameError)

$ ruby -v -e 'send("foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in <main>': undefined methodfoo' for main:Object (NoMethodError)

Associated revisions

Revision 38558
Added by Nobuyoshi Nakada over 1 year ago

internal.h: quote unprintable

  • internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574]
  • string.c (rbstrquote_unprintable): ditto.

History

#1 Updated by Koichi Sasada over 1 year ago

  • Assignee set to Nobuyoshi Nakada

#2 Updated by Usaku NAKAMURA over 1 year ago

  • Status changed from Open to Assigned

#3 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38558.
tadayoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


internal.h: quote unprintable

  • internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574]
  • string.c (rbstrquote_unprintable): ditto.

Also available in: Atom PDF