mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (rb_eval): overriding false constant with class/module
definition should be error. (PR#327) * eval.c (rb_call0): preset source file/line to pass correct ones to trace_func at end of empty method. [ruby-dev:18035] * ruby.c (require_libraries): not clear source file. [ruby-dev:18074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e582932d92
commit
b937582d09
3 changed files with 16 additions and 9 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Thu Sep 5 13:09:22 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* eval.c (rb_eval): overriding false constant with class/module
|
||||
definition should be error. (PR#327)
|
||||
|
||||
* eval.c (rb_call0): preset source file/line to pass correct ones
|
||||
to trace_func at end of empty method. [ruby-dev:18035]
|
||||
|
||||
* ruby.c (require_libraries): not clear source file.
|
||||
[ruby-dev:18074]
|
||||
|
||||
Tue Sep 3 00:22:43 2002 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* gc.c (gc_sweep): does reclaim nodes in also compile time, if we
|
||||
|
|
13
eval.c
13
eval.c
|
@ -3122,14 +3122,11 @@ rb_eval(self, n)
|
|||
super = 0;
|
||||
}
|
||||
|
||||
klass = 0;
|
||||
if ((ruby_class == rb_cObject) && rb_autoload_defined(node->nd_cname)) {
|
||||
rb_autoload_load(node->nd_cname);
|
||||
}
|
||||
if (rb_const_defined_at(ruby_class, node->nd_cname)) {
|
||||
klass = rb_const_get(ruby_class, node->nd_cname);
|
||||
}
|
||||
if (klass) {
|
||||
if (TYPE(klass) != T_CLASS) {
|
||||
rb_raise(rb_eTypeError, "%s is not a class",
|
||||
rb_id2name(node->nd_cname));
|
||||
|
@ -3169,14 +3166,11 @@ rb_eval(self, n)
|
|||
if (NIL_P(ruby_class)) {
|
||||
rb_raise(rb_eTypeError, "no outer class/module");
|
||||
}
|
||||
module = 0;
|
||||
if ((ruby_class == rb_cObject) && rb_autoload_defined(node->nd_cname)) {
|
||||
rb_autoload_load(node->nd_cname);
|
||||
}
|
||||
if (rb_const_defined_at(ruby_class, node->nd_cname)) {
|
||||
module = rb_const_get(ruby_class, node->nd_cname);
|
||||
}
|
||||
if (module) {
|
||||
if (TYPE(module) != T_MODULE) {
|
||||
rb_raise(rb_eTypeError, "%s is not a module",
|
||||
rb_id2name(node->nd_cname));
|
||||
|
@ -4561,8 +4555,11 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
|
|||
}
|
||||
|
||||
if (trace_func) {
|
||||
call_trace_func("call", b2->nd_file, nd_line(b2),
|
||||
recv, id, klass);
|
||||
char *file = b2->nd_file;
|
||||
int line = nd_line(b2);
|
||||
call_trace_func("call", file, line, recv, id, klass);
|
||||
ruby_sourcefile = file;
|
||||
ruby_sourceline = line;
|
||||
}
|
||||
result = rb_eval(recv, body);
|
||||
}
|
||||
|
|
1
ruby.c
1
ruby.c
|
@ -314,7 +314,6 @@ require_libraries()
|
|||
struct req_list *tmp;
|
||||
|
||||
Init_ext(); /* should be called here for some reason :-( */
|
||||
ruby_sourcefile = 0;
|
||||
save[0] = ruby_eval_tree;
|
||||
save[1] = ruby_eval_tree_begin;
|
||||
ruby_eval_tree = ruby_eval_tree_begin = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue