diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-20 04:28:52 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-20 04:28:52 +0000 |
commit | 22768f9aefdb5e7a466bfd4e63dbfdf2bc5184b8 (patch) | |
tree | 33117ceb2e479bc146c1f40711234ae780df5748 | |
parent | 92886835719364eac3497eeb74f10dce1ff6275a (diff) |
* hash.c (rb_any_cmp): should handle Qundef in keys.
* eval.c (remove_method): should not remove a empty method to
implement "undef".
* eval.c (rb_eval): should allow singleton class def for
true/false/nil.
* parse.y (str_extend): backslash escape was done wrong.
* class.c (rb_include_module): should preserve ancestor order in
the included class/module.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | class.c | 4 | ||||
-rw-r--r-- | eval.c | 31 | ||||
-rw-r--r-- | hash.c | 1 | ||||
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | version.h | 4 |
6 files changed, 47 insertions, 14 deletions
@@ -1,3 +1,13 @@ +Wed Feb 20 12:41:59 2002 Yukihiro Matsumoto <matz@ruby-lang.org> + + * hash.c (rb_any_cmp): should handle Qundef in keys. + + * eval.c (remove_method): should not remove a empty method to + implement "undef". + + * eval.c (rb_eval): should allow singleton class def for + true/false/nil. + Tue Feb 19 22:49:29 2002 Minero Aoki <aamine@loveruby.net> * lib/net/http.rb: remove unused class Accumulator. @@ -10,6 +20,15 @@ Tue Feb 19 22:49:29 2002 Minero Aoki <aamine@loveruby.net> * doc/net/http.rb: modify typo in the description of basic auth. +Tue Feb 19 20:20:12 2002 Ed Sinjiashvili <edsin@swes.saren.ru> + + * parse.y (str_extend): backslash escape was done wrong. + +Tue Feb 19 15:51:41 2002 Yukihiro Matsumoto <matz@ruby-lang.org> + + * class.c (rb_include_module): should preserve ancestor order in + the included class/module. + Tue Feb 19 14:45:32 2002 Yukihiro Matsumoto <matz@ruby-lang.org> * marshal.c (r_object): complete restoration before calling @@ -330,8 +330,10 @@ rb_include_module(klass, module) /* ignore if the module included already in superclasses */ for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) { if (BUILTIN_TYPE(p) == T_ICLASS) { - if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) + if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) { + c = p; goto skip; + } } } RCLASS(c)->super = include_class_new(module, RCLASS(c)->super); @@ -314,7 +314,7 @@ remove_method(klass, mid) rb_raise(rb_eSecurityError, "Insecure: can't remove method"); } if (OBJ_FROZEN(klass)) rb_error_frozen("class/module"); - if (!st_delete(RCLASS(klass)->m_tbl, &mid, &body)) { + if (!st_delete(RCLASS(klass)->m_tbl, &mid, &body) || !body->nd_body) { rb_raise(rb_eNameError, "method `%s' not defined in %s", rb_id2name(mid), rb_class2name(klass)); } @@ -3159,17 +3159,28 @@ rb_eval(self, n) { VALUE klass; - klass = rb_eval(self, node->nd_recv); - if (rb_special_const_p(klass)) { - rb_raise(rb_eTypeError, "no virtual class for %s", - rb_class2name(CLASS_OF(klass))); + result = rb_eval(self, node->nd_recv); + if (result == Qtrue) { + klass = rb_cTrueClass; } - if (rb_safe_level() >= 4 && !OBJ_TAINTED(klass)) - rb_raise(rb_eSecurityError, "Insecure: can't extend object"); - if (FL_TEST(CLASS_OF(klass), FL_SINGLETON)) { - rb_clear_cache(); + else if (result == Qfalse) { + klass = rb_cTrueClass; + } + else if (result == Qnil) { + klass = rb_cNilClass; + } + else { + if (rb_special_const_p(result)) { + rb_raise(rb_eTypeError, "no virtual class for %s", + rb_class2name(CLASS_OF(klass))); + } + if (rb_safe_level() >= 4 && !OBJ_TAINTED(result)) + rb_raise(rb_eSecurityError, "Insecure: can't extend object"); + if (FL_TEST(CLASS_OF(result), FL_SINGLETON)) { + rb_clear_cache(); + } + klass = rb_singleton_class(result); } - klass = rb_singleton_class(klass); if (ruby_wrapper) { rb_extend_object(klass, ruby_wrapper); @@ -69,6 +69,7 @@ rb_any_cmp(a, b) if (SYMBOL_P(a) && SYMBOL_P(b)) { return a != b; } + if (a == Qundef || b == Qundef) return -1; args[0] = a; args[1] = b; @@ -3933,7 +3933,7 @@ str_extend(list, term, paren) tokadd('\\'); tokadd(c); } - break; + goto loop_again; case '{': if (brace != -1) brace_nest++; default: @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.6" -#define RUBY_RELEASE_DATE "2002-02-19" +#define RUBY_RELEASE_DATE "2002-02-20" #define RUBY_VERSION_CODE 166 -#define RUBY_RELEASE_CODE 20020219 +#define RUBY_RELEASE_CODE 20020220 |