summaryrefslogtreecommitdiff
path: root/ext/-test-/symbol
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-06 07:29:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-06 07:29:33 +0000
commit89fef02f1305887d97ddcf96cc4df9109ce414e2 (patch)
tree1af1003f121923e1b7970be82d2a8df7e7122bd7 /ext/-test-/symbol
parent60d83c5da49aade87ee4a45ca777637000f60cfb (diff)
* vm_eval.c (make_no_method_execption): extract from
raise_method_missing(). * vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans <code AT jeremyevans.net> in [ruby-core:38576]. [Feature #5112] * vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and __send__, too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/symbol')
-rw-r--r--ext/-test-/symbol/extconf.rb6
-rw-r--r--ext/-test-/symbol/init.c11
-rw-r--r--ext/-test-/symbol/intern.c14
3 files changed, 31 insertions, 0 deletions
diff --git a/ext/-test-/symbol/extconf.rb b/ext/-test-/symbol/extconf.rb
new file mode 100644
index 0000000..d093ff6
--- /dev/null
+++ b/ext/-test-/symbol/extconf.rb
@@ -0,0 +1,6 @@
+$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+inits = $srcs.map {|s| File.basename(s, ".*")}
+inits.delete("init")
+inits.map! {|s|"X(#{s})"}
+$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
+create_makefile("-test-/symbol/symbol")
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
new file mode 100644
index 0000000..e740345
--- /dev/null
+++ b/ext/-test-/symbol/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_symbol(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Symbol", rb_cSymbol);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/symbol/intern.c b/ext/-test-/symbol/intern.c
new file mode 100644
index 0000000..6ae86a6
--- /dev/null
+++ b/ext/-test-/symbol/intern.c
@@ -0,0 +1,14 @@
+#include "ruby.h"
+
+static VALUE
+bug_sym_interned_p(VALUE self, VALUE name)
+{
+ ID id = rb_check_id(&name);
+ return id ? Qtrue : Qfalse;
+}
+
+void
+Init_intern(VALUE klass)
+{
+ rb_define_singleton_method(klass, "interned?", bug_sym_interned_p, 1);
+}