summaryrefslogtreecommitdiff
path: root/ext/-test-/symbol
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 16:11:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 16:11:55 +0000
commit8eb0c810b228df1f8352c005a7ae882ad4179b4b (patch)
treecf267fa288dbfce9b48a549b7b9b021cdea21be8 /ext/-test-/symbol
parentdf06c2844288bd59cdcc4e5bed225728d0b2adbc (diff)
get rid of inadvertent ID creation
* object.c (rb_mod_const_get, rb_mod_const_defined): ditto. * variable.c (rb_const_missing, rb_mod_const_missing): call const_missing without new ID to get rid of inadvertent ID creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/symbol')
-rw-r--r--ext/-test-/symbol/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
index 3b7cf15..9e42e1a 100644
--- a/ext/-test-/symbol/init.c
+++ b/ext/-test-/symbol/init.c
@@ -8,11 +8,18 @@ sym_find(VALUE dummy, VALUE sym)
return rb_check_symbol(&sym);
}
+static VALUE
+sym_pinneddown_p(VALUE dummy, VALUE sym)
+{
+ return rb_check_id(&sym) ? Qtrue : Qfalse;
+}
+
void
Init_symbol(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "Symbol", rb_cSymbol);
rb_define_singleton_method(klass, "find", sym_find, 1);
+ rb_define_singleton_method(klass, "pinneddown?", sym_pinneddown_p, 1);
TEST_INIT_FUNCS(init);
}