mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* struct.c (make_struct): remove redefining constant when
conflict. [ruby-dev:24210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c5f07b3cbc
commit
01e181146a
4 changed files with 16 additions and 35 deletions
34
eval.c
34
eval.c
|
@ -1715,37 +1715,6 @@ rb_eval_cmd(cmd, arg, level)
|
|||
return val;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
superclass(self, node)
|
||||
VALUE self;
|
||||
NODE *node;
|
||||
{
|
||||
VALUE val = Qnil; /* OK */
|
||||
int state;
|
||||
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
val = rb_eval(self, node);
|
||||
}
|
||||
POP_TAG();
|
||||
if (state) {
|
||||
switch (nd_type(node)) {
|
||||
case NODE_COLON2:
|
||||
rb_raise(rb_eTypeError, "undefined superclass `%s'",
|
||||
rb_id2name(node->nd_mid));
|
||||
case NODE_CONST:
|
||||
rb_raise(rb_eTypeError, "undefined superclass `%s'",
|
||||
rb_id2name(node->nd_vid));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JUMP_TAG(state);
|
||||
}
|
||||
rb_check_inheritable(val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
#define ruby_cbase (ruby_cref->nd_clss)
|
||||
|
||||
static VALUE
|
||||
|
@ -3792,7 +3761,8 @@ rb_eval(self, n)
|
|||
rb_raise(rb_eTypeError, "no outer class/module");
|
||||
}
|
||||
if (node->nd_super) {
|
||||
super = superclass(self, node->nd_super);
|
||||
super = rb_eval(self, node->nd_super);
|
||||
rb_check_inheritable(super);
|
||||
}
|
||||
else {
|
||||
super = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue