Skip to content

Commit

Permalink
Merge pull request #109 from syucream/fix/setobj
Browse files Browse the repository at this point in the history
Replace BOXNIX_SET_VALUE with mrb_obj_value()
  • Loading branch information
syucream committed Dec 11, 2016
2 parents 6c9f01c + d140f01 commit 383ad1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/ts_mruby_eventsystem.cpp
Expand Up @@ -106,12 +106,9 @@ EventSystemPlugin::callHandler_(shared_ptr<TSMrubyContext> context, const uint8_
mrb->ud = reinterpret_cast<void *>(context.get());

RProc* closure = mrb_closure_new(mrb, mrb_read_irep(mrb, handler_irep));
mrb_value proc = mrb_obj_value(closure);

// NOTE Its boxing_no specific
mrb_value proc_value;
BOXNIX_SET_VALUE(proc_value, MRB_TT_PROC, value.p, (closure));

return mrb_yield(mrb, proc_value, mrb_nil_value());
return mrb_yield(mrb, proc, mrb_nil_value());
}

static mrb_value ts_mrb_register_es(mrb_state *mrb,
Expand Down
7 changes: 2 additions & 5 deletions src/ts_mruby_internal.cpp
Expand Up @@ -228,13 +228,10 @@ void FilterPlugin::handleInputComplete() {
mrb_state* mrb = tlmrb->getMrb();

RProc* closure = mrb_closure_new(mrb, mrb_read_irep(mrb, handler_));

// NOTE Its boxing_no specific
mrb_value proc_value;
BOXNIX_SET_VALUE(proc_value, MRB_TT_PROC, value.p, (closure));
mrb_value proc = mrb_obj_value(closure);

mrb_value rv =
mrb_yield(mrb, proc_value, mrb_str_new(mrb, origBuffer_.c_str(),
mrb_yield(mrb, proc, mrb_str_new(mrb, origBuffer_.c_str(),
origBuffer_.length()));

// Convert to_s if the value isn't Ruby string
Expand Down

0 comments on commit 383ad1b

Please sign in to comment.