mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* string.c (Init_String): undef Symbol#new.
* struct.c (rb_struct_s_def): wrong symbol detection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d064c0bf13
commit
10a0dea1f5
3 changed files with 11 additions and 10 deletions
11
struct.c
11
struct.c
|
@ -282,14 +282,9 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
|
|||
id = rb_to_id(RARRAY_PTR(rest)[i]);
|
||||
RARRAY_PTR(rest)[i] = ID2SYM(id);
|
||||
}
|
||||
if (!NIL_P(name)) {
|
||||
VALUE tmp = rb_check_string_type(name);
|
||||
|
||||
if (NIL_P(tmp)) {
|
||||
id = rb_to_id(name);
|
||||
rb_ary_unshift(rest, ID2SYM(id));
|
||||
name = Qnil;
|
||||
}
|
||||
if (!NIL_P(name) && SYMBOL_P(name)) {
|
||||
rb_ary_unshift(rest, name);
|
||||
name = Qnil;
|
||||
}
|
||||
st = make_struct(name, rest, klass);
|
||||
if (rb_block_given_p()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue