summaryrefslogtreecommitdiff
path: root/ext/-test-/rb_call_super_kw/rb_call_super_kw.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-16 13:19:06 -0700
committerJeremy Evans <code@jeremyevans.net>2019-09-17 16:22:44 -0700
commit9b35dc38644c10eed008f9ba19a7224f2fb49af2 (patch)
tree9c6c97cfd1cd828d8796145956621d6ac08ea6e8 /ext/-test-/rb_call_super_kw/rb_call_super_kw.c
parent0785469a400b00eb4576fedbf93b614c70eaf760 (diff)
Pass keyword argument flag when rb_call_super_kw calls method_missing
This makes method_missing take a flag for whether keyword arguments were passed. Adds tests both for rb_call_super_kw usage as well as general usage of super calling method_missing in Ruby methods.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2462
Diffstat (limited to 'ext/-test-/rb_call_super_kw/rb_call_super_kw.c')
-rw-r--r--ext/-test-/rb_call_super_kw/rb_call_super_kw.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/-test-/rb_call_super_kw/rb_call_super_kw.c b/ext/-test-/rb_call_super_kw/rb_call_super_kw.c
new file mode 100644
index 0000000000..7f094545d2
--- /dev/null
+++ b/ext/-test-/rb_call_super_kw/rb_call_super_kw.c
@@ -0,0 +1,14 @@
+#include <ruby.h>
+
+static VALUE
+rb_call_super_kw_m(int argc, VALUE *argv, VALUE self)
+{
+ return rb_call_super_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
+}
+
+void
+Init_rb_call_super_kw(void) {
+ VALUE module = rb_define_module("Bug");
+ module = rb_define_module_under(module, "RbCallSuperKw");
+ rb_define_method(module, "m", rb_call_super_kw_m, -1);
+}