* proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
init place of exception_error. * inits.c: ditto. * eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL. [ruby-dev:31407] * bootstraptest/test_exception.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9cdeae9dad
commit
14c3aa52ae
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Tue Aug 14 19:53:15 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
|
||||||
|
init place of exception_error.
|
||||||
|
|
||||||
|
* inits.c: ditto.
|
||||||
|
|
||||||
|
* eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL.
|
||||||
|
[ruby-dev:31407]
|
||||||
|
|
||||||
|
* bootstraptest/test_exception.rb: add a test for above.
|
||||||
|
|
||||||
Tue Aug 14 19:51:20 2007 Koichi Sasada <ko1@atdot.net>
|
Tue Aug 14 19:51:20 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* common.mk: change test order (test -> btest).
|
* common.mk: change test order (test -> btest).
|
||||||
|
@ -368,3 +368,26 @@ assert_equal %q{}, %q{
|
|||||||
end
|
end
|
||||||
end.call
|
end.call
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##
|
||||||
|
assert_equal "ok", %q{
|
||||||
|
$foo = "ok"
|
||||||
|
class C
|
||||||
|
def inspect
|
||||||
|
bar {}
|
||||||
|
$foo = "ng"
|
||||||
|
end
|
||||||
|
|
||||||
|
def bar
|
||||||
|
raise
|
||||||
|
ensure
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
C.new.foo
|
||||||
|
rescue NoMethodError => e
|
||||||
|
$foo
|
||||||
|
end
|
||||||
|
}, "[ruby-dev:31407]"
|
||||||
|
|
||||||
|
7
eval.c
7
eval.c
@ -29,9 +29,10 @@ static ID object_id, __send, __send_bang, respond_to;
|
|||||||
|
|
||||||
VALUE rb_eLocalJumpError;
|
VALUE rb_eLocalJumpError;
|
||||||
VALUE rb_eSysStackError;
|
VALUE rb_eSysStackError;
|
||||||
VALUE exception_error;
|
|
||||||
VALUE sysstack_error;
|
VALUE sysstack_error;
|
||||||
|
|
||||||
|
static VALUE exception_error;
|
||||||
|
|
||||||
static VALUE eval(VALUE, VALUE, VALUE, const char *, int);
|
static VALUE eval(VALUE, VALUE, VALUE, const char *, int);
|
||||||
|
|
||||||
static inline VALUE rb_yield_0(int argc, VALUE *argv);
|
static inline VALUE rb_yield_0(int argc, VALUE *argv);
|
||||||
@ -2726,6 +2727,10 @@ Init_eval(void)
|
|||||||
rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
|
rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
|
||||||
|
|
||||||
rb_define_virtual_variable("$SAFE", safe_getter, safe_setter);
|
rb_define_virtual_variable("$SAFE", safe_getter, safe_setter);
|
||||||
|
|
||||||
|
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
||||||
|
rb_ivar_set(exception_error, idThrowState, INT2FIX(TAG_FATAL));
|
||||||
|
rb_register_mark_object(exception_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -177,8 +177,6 @@ char *strrchr _((const char *, const char));
|
|||||||
ruby_cref()->nd_visi = (f); \
|
ruby_cref()->nd_visi = (f); \
|
||||||
}
|
}
|
||||||
|
|
||||||
extern VALUE exception_error;
|
|
||||||
|
|
||||||
void rb_thread_cleanup _((void));
|
void rb_thread_cleanup _((void));
|
||||||
void rb_thread_wait_other_threads _((void));
|
void rb_thread_wait_other_threads _((void));
|
||||||
|
|
||||||
|
2
inits.c
2
inits.c
@ -63,10 +63,10 @@ rb_call_inits()
|
|||||||
Init_Comparable();
|
Init_Comparable();
|
||||||
Init_Enumerable();
|
Init_Enumerable();
|
||||||
Init_Precision();
|
Init_Precision();
|
||||||
|
Init_Exception();
|
||||||
Init_eval();
|
Init_eval();
|
||||||
Init_jump();
|
Init_jump();
|
||||||
Init_String();
|
Init_String();
|
||||||
Init_Exception();
|
|
||||||
Init_Numeric();
|
Init_Numeric();
|
||||||
Init_Bignum();
|
Init_Bignum();
|
||||||
Init_syserr();
|
Init_syserr();
|
||||||
|
2
proc.c
2
proc.c
@ -1443,8 +1443,6 @@ Init_Proc(void)
|
|||||||
rb_eLocalJumpError = rb_define_class("LocalJumpError", rb_eStandardError);
|
rb_eLocalJumpError = rb_define_class("LocalJumpError", rb_eStandardError);
|
||||||
rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0);
|
rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0);
|
||||||
rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0);
|
rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0);
|
||||||
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
|
||||||
rb_register_mark_object(exception_error);
|
|
||||||
|
|
||||||
rb_eSysStackError = rb_define_class("SystemStackError", rb_eException);
|
rb_eSysStackError = rb_define_class("SystemStackError", rb_eException);
|
||||||
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
|
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user