Ejemplo n.º 1
0
  ThreadState* VMThreadState::state_as_object(STATE) {
    if(raise_reason_ == cNone && current_exception_.get()->nil_p()) return nil<ThreadState>();

    ThreadState* thread_state = ThreadState::create(state);
    thread_state->raise_reason(state, Fixnum::from(raise_reason_));
    thread_state->destination_scope(state, destination_scope());
    thread_state->throw_dest(state, throw_dest());
    thread_state->current_exception(state, current_exception());
    thread_state->raise_value(state, raise_value());
    return thread_state;
  }
Ejemplo n.º 2
0
  Object* ThreadState::state_as_object(STATE) {
    if(raise_reason_ == cNone && current_exception_.get()->nil_p()) return cNil;

    Exception* exc = Exception::create(state);
    exc->klass(state, G(exc_vm_internal));
    exc->set_ivar(state, state->symbol("reason"), Fixnum::from(raise_reason_));
    exc->set_ivar(state, state->symbol("destination"), destination_scope());
    exc->set_ivar(state, state->symbol("throw_dest"), throw_dest());

    exc->set_ivar(state, state->symbol("exception"),  current_exception());
    exc->set_ivar(state, state->symbol("value"),  raise_value());
    return exc;
  }