diff options
| -rw-r--r-- | include/mruby/variable.h | 1 | ||||
| -rw-r--r-- | src/variable.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/mruby/variable.h b/include/mruby/variable.h index d33a20d5e..8754e8a90 100644 --- a/include/mruby/variable.h +++ b/include/mruby/variable.h @@ -56,6 +56,7 @@ mrb_value mrb_obj_iv_inspect(mrb_state*, struct RObject*); mrb_sym mrb_class_sym(mrb_state *mrb, struct RClass *c, struct RClass *outer); mrb_value mrb_mod_class_variables(mrb_state*, mrb_value); mrb_value mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym); +mrb_value mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym); /* GC functions */ void mrb_gc_mark_gv(mrb_state*); diff --git a/src/variable.c b/src/variable.c index b4e262f8d..816b703bf 100644 --- a/src/variable.c +++ b/src/variable.c @@ -690,6 +690,12 @@ mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym) } mrb_value +mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym) +{ + return mrb_mod_cv_get(mrb, mrb_class_ptr(mod), sym); +} + +mrb_value mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym) { struct RClass *c = mrb->ci->proc->target_class; |
