summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-20 11:27:06 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-20 11:27:06 +0900
commit7195600dbf8d1683bcc5e9bfc3dd8547c222694e (patch)
treecd6841e739d9ed84078bed65cd3abe7cc9c5873a /mrbgems
parent4b6de9dea6f630b62db12102b9212740f935b9b6 (diff)
parent4004e122a28f48206dc1f39c731993c632d7ac6a (diff)
downloadmruby-7195600dbf8d1683bcc5e9bfc3dd8547c222694e.tar.gz
mruby-7195600dbf8d1683bcc5e9bfc3dd8547c222694e.zip
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-bin-strip/mrbgem.rake1
-rw-r--r--mrbgems/mruby-proc-ext/src/proc.c46
-rw-r--r--mrbgems/mruby-proc-ext/test/proc.rb14
3 files changed, 0 insertions, 61 deletions
diff --git a/mrbgems/mruby-bin-strip/mrbgem.rake b/mrbgems/mruby-bin-strip/mrbgem.rake
index 7dfc5912d..2abd25eea 100644
--- a/mrbgems/mruby-bin-strip/mrbgem.rake
+++ b/mrbgems/mruby-bin-strip/mrbgem.rake
@@ -3,5 +3,4 @@ MRuby::Gem::Specification.new('mruby-bin-strip') do |spec|
spec.author = 'mruby developers'
spec.summary = 'irep dump debug section remover command'
spec.bins = %w(mruby-strip)
- spec.add_dependency 'mruby-proc-ext', :core =>'mruby-proc-ext'
end
diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c
index 546ed49e5..b105c95d7 100644
--- a/mrbgems/mruby-proc-ext/src/proc.c
+++ b/mrbgems/mruby-proc-ext/src/proc.c
@@ -122,51 +122,6 @@ mrb_kernel_proc(mrb_state *mrb, mrb_value self)
return blk;
}
-static mrb_value
-mrb_local_variables(mrb_state *mrb, mrb_value self)
-{
- mrb_value ret;
- struct RProc *proc;
- struct mrb_irep *irep;
- size_t i;
-
- proc = mrb->c->ci[-1].proc;
-
- if (MRB_PROC_CFUNC_P(proc)) {
- return mrb_ary_new(mrb);
- }
-
- irep = proc->body.irep;
- if (!irep->lv) {
- return mrb_ary_new(mrb);
- }
- ret = mrb_ary_new_capa(mrb, irep->nlocals - 1);
- for (i = 0; i + 1 < irep->nlocals; ++i) {
- if (irep->lv[i].name) {
- mrb_ary_push(mrb, ret, mrb_symbol_value(irep->lv[i].name));
- }
- }
- if (proc->env) {
- struct REnv *e = proc->env;
-
- while (e) {
- if (!MRB_PROC_CFUNC_P(mrb->c->cibase[e->cioff].proc)) {
- irep = mrb->c->cibase[e->cioff].proc->body.irep;
- if (irep->lv) {
- for (i = 0; i + 1 < irep->nlocals; ++i) {
- if (irep->lv[i].name) {
- mrb_ary_push(mrb, ret, mrb_symbol_value(irep->lv[i].name));
- }
- }
- }
- }
- e = (struct REnv*)e->c;
- }
- }
-
- return ret;
-}
-
void
mrb_mruby_proc_ext_gem_init(mrb_state* mrb)
{
@@ -178,7 +133,6 @@ mrb_mruby_proc_ext_gem_init(mrb_state* mrb)
mrb_define_class_method(mrb, mrb->kernel_module, "proc", mrb_kernel_proc, MRB_ARGS_NONE());
mrb_define_method(mrb, mrb->kernel_module, "proc", mrb_kernel_proc, MRB_ARGS_NONE());
- mrb_define_module_function(mrb, mrb->kernel_module, "local_variables", mrb_local_variables, MRB_ARGS_NONE());
}
void
diff --git a/mrbgems/mruby-proc-ext/test/proc.rb b/mrbgems/mruby-proc-ext/test/proc.rb
index 443bd330c..0f5ecfb94 100644
--- a/mrbgems/mruby-proc-ext/test/proc.rb
+++ b/mrbgems/mruby-proc-ext/test/proc.rb
@@ -74,17 +74,3 @@ assert('mrb_cfunc_env_get') do
assert_equal 1, t.get_int(1)
end
-
-assert('Kernel.local_variables', '15.3.1.2.7') do
- a, b = 0, 1
- a += b
-
- vars = Kernel.local_variables.sort
- assert_equal [:a, :b, :vars], vars
-
- proc {
- c = 2
- vars = Kernel.local_variables.sort
- assert_equal [:a, :b, :c, :vars], vars
- }.call
-end