diff options
| -rw-r--r-- | src/array.c | 4 | ||||
| -rw-r--r-- | tools/mruby/mruby.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/array.c b/src/array.c index ec687bbf3..ed1c3f475 100644 --- a/src/array.c +++ b/src/array.c @@ -1006,7 +1006,7 @@ mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep) /* * call-seq: - * ary.join(sep=nil) -> str + * ary.join(sep="") -> str * * Returns a string created by converting each element of the array to * a string, separated by <i>sep</i>. @@ -1020,7 +1020,7 @@ mrb_ary_join_m(mrb_state *mrb, mrb_value ary) { mrb_value sep = mrb_nil_value(); - mrb_get_args(mrb, "|o", &sep); + mrb_get_args(mrb, "|S", &sep); return mrb_ary_join(mrb, ary, sep); } diff --git a/tools/mruby/mruby.c b/tools/mruby/mruby.c index d3c22f96d..abc0bdc5e 100644 --- a/tools/mruby/mruby.c +++ b/tools/mruby/mruby.c @@ -196,11 +196,13 @@ main(int argc, char **argv) v = mrb_load_file_cxt(mrb, args.rfp, c); } mrbc_context_free(mrb, c); - if (args.check_syntax) { - printf("Syntax OK\n"); + if (mrb->exc) { + if (!mrb_undef_p(v)) { + mrb_p(mrb, mrb_obj_value(mrb->exc)); + } } - else if (!mrb_undef_p(v) && mrb->exc) { - mrb_p(mrb, mrb_obj_value(mrb->exc)); + else if (args.check_syntax) { + printf("Syntax OK\n"); } } cleanup(mrb, &args); |
