ruby-changes:25014
From: nobu <ko1@a...>
Date: Tue, 2 Oct 2012 16:47:24 +0900 (JST)
Subject: [ruby-changes:25014] nobu:r37066 (trunk): eval.c: hide internal hash
nobu 2012-10-02 16:47:11 +0900 (Tue, 02 Oct 2012) New Revision: 37066 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37066 Log: eval.c: hide internal hash * eval.c (identity_hash_new): hide internal hashes for refinements. * eval.c (rb_mod_refine): no default value. Modified files: trunk/ChangeLog trunk/eval.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37065) +++ ChangeLog (revision 37066) @@ -1,3 +1,9 @@ +Tue Oct 2 16:47:06 2012 Nobuyoshi Nakada <nobu@r...> + + * eval.c (identity_hash_new): hide internal hashes for refinements. + + * eval.c (rb_mod_refine): no default value. + Mon Oct 1 22:54:02 2012 Shugo Maeda <shugo@r...> * eval.c (identity_hash_new): new function to create a new identity Index: eval.c =================================================================== --- eval.c (revision 37065) +++ eval.c (revision 37066) @@ -1046,11 +1046,7 @@ VALUE hash = rb_hash_new(); rb_funcall(hash, rb_intern("compare_by_identity"), 0); -#if 0 - /* FIXME: The following code hides hash, but causes "method `default' - * called on hidden T_HASH object" error. */ RBASIC(hash)->klass = 0; -#endif return hash; } @@ -1214,7 +1210,7 @@ overlaid_modules = identity_hash_new(); rb_ivar_set(module, id_overlaid_modules, overlaid_modules); } - mod = rb_hash_aref(overlaid_modules, klass); + mod = rb_hash_lookup(overlaid_modules, klass); if (NIL_P(mod)) { mod = rb_module_new(); CONST_ID(id_refined_class, "__refined_class__"); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/