summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-02 07:47:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-02 07:47:11 +0000
commita416367b0434e52ae2eef0ea84c19a2c1e3d05ca (patch)
tree10057c5c0e47a5a02f48c36afd12fdfc3424114b /eval.c
parent39ef471e2d460141fc7c71b66b7ec6c7b520faed (diff)
eval.c: hide internal hash
* eval.c (identity_hash_new): hide internal hashes for refinements. * eval.c (rb_mod_refine): no default value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 789ca37a03..053d4ac8bf 100644
--- a/eval.c
+++ b/eval.c
@@ -1046,11 +1046,7 @@ identity_hash_new()
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 @@ rb_mod_refine(VALUE module, VALUE klass)
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__");