Project

General

Profile

Bug #7574

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

Added by tadayoshi funaba over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
ruby -v:
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
[ruby-dev:46749]

Description

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

$ ruby -v -e 'instance_variable_get("@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.class_variable_get("@@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.const_set("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.const_get("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 3 years ago

internal.h: quote unprintable

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

Revision 38558
Added by Nobuyoshi Nakada over 3 years ago

internal.h: quote unprintable

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

Revision 38558
Added by Nobuyoshi Nakada over 3 years ago

internal.h: quote unprintable

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

History

#1 [ruby-dev:46789] Updated by Koichi Sasada over 3 years ago

  • Assignee set to Nobuyoshi Nakada

#2 [ruby-dev:46794] Updated by Usaku NAKAMURA over 3 years ago

  • Status changed from Open to Assigned

#3 Updated by Nobuyoshi Nakada over 3 years 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 (rb_str_quote_unprintable): ditto.

Also available in: Atom PDF