summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-mruby
diff options
context:
space:
mode:
authorfleuria <[email protected]>2013-11-03 11:32:59 +0800
committerfleuria <[email protected]>2013-11-03 11:32:59 +0800
commitd75a907edf761b823d83aa658025de52508b8966 (patch)
treebe384155c9a34aeb4b12aba9801e707df752d30d /mrbgems/mruby-bin-mruby
parentd2451dfb1660c219e7ba7bc2ae4ee859040b8d84 (diff)
downloadmruby-d75a907edf761b823d83aa658025de52508b8966.tar.gz
mruby-d75a907edf761b823d83aa658025de52508b8966.zip
introduce mrb_context_run()
currently there are two scnenario to call mrb_run(), the first is calling a proc, in this case mrb should create a new environment, discarding all the variables except args, reciever and block. the second is calling the newly generated irep, like in mirb. in this case, the variables should be kept after mrb_run(). so we introduce mrb_context_run() to handle this seperately.
Diffstat (limited to 'mrbgems/mruby-bin-mruby')
-rw-r--r--mrbgems/mruby-bin-mruby/tools/mruby/mruby.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
index baeb95993..f1d6bea56 100644
--- a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
+++ b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
@@ -203,7 +203,7 @@ main(int argc, char **argv)
fprintf(stderr, "failed to load mrb file: %s\n", args.cmdline);
}
else if (!args.check_syntax) {
- mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb));
+ mrb_context_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb));
n = 0;
if (mrb->exc) {
mrb_print_error(mrb);