mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
precedes registering global VALUE variables before initializing it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
81be039884
commit
c423d3cbf2
4 changed files with 11 additions and 12 deletions
8
eval.c
8
eval.c
|
@ -7612,8 +7612,8 @@ Init_eval(void)
|
|||
|
||||
rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1);
|
||||
respond_to = rb_intern("respond_to?");
|
||||
basic_respond_to = rb_method_node(rb_cObject, respond_to);
|
||||
rb_global_variable((VALUE*)&basic_respond_to);
|
||||
basic_respond_to = rb_method_node(rb_cObject, respond_to);
|
||||
|
||||
rb_define_global_function("raise", rb_f_raise, -1);
|
||||
rb_define_global_function("fail", rb_f_raise, -1);
|
||||
|
@ -9355,13 +9355,13 @@ Init_Proc(void)
|
|||
rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0);
|
||||
rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0);
|
||||
|
||||
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
||||
rb_global_variable(&exception_error);
|
||||
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
||||
|
||||
rb_eSysStackError = rb_define_class("SystemStackError", rb_eException);
|
||||
rb_global_variable(&sysstack_error);
|
||||
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
|
||||
OBJ_TAINT(sysstack_error);
|
||||
rb_global_variable(&sysstack_error);
|
||||
|
||||
rb_cProc = rb_define_class("Proc", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cProc);
|
||||
|
@ -12815,9 +12815,9 @@ Init_Thread(void)
|
|||
rb_define_method(cThGroup, "enclose", thgroup_enclose, 0);
|
||||
rb_define_method(cThGroup, "enclosed?", thgroup_enclosed_p, 0);
|
||||
rb_define_method(cThGroup, "add", thgroup_add, 1);
|
||||
rb_global_variable(&thgroup_default);
|
||||
thgroup_default = rb_obj_alloc(cThGroup);
|
||||
rb_define_const(cThGroup, "Default", thgroup_default);
|
||||
rb_global_variable(&thgroup_default);
|
||||
|
||||
/* allocate main thread */
|
||||
main_thread = rb_thread_alloc(rb_cThread);
|
||||
|
|
2
gc.c
2
gc.c
|
@ -1909,6 +1909,6 @@ Init_GC(void)
|
|||
|
||||
source_filenames = st_init_strtable();
|
||||
|
||||
nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory");
|
||||
rb_global_variable(&nomem_error);
|
||||
nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory");
|
||||
}
|
||||
|
|
11
io.c
11
io.c
|
@ -5557,12 +5557,12 @@ Init_IO(void)
|
|||
rb_define_method(rb_cIO, "pid", rb_io_pid, 0);
|
||||
rb_define_method(rb_cIO, "inspect", rb_io_inspect, 0);
|
||||
|
||||
rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO, "<STDIN>");
|
||||
rb_define_variable("$stdin", &rb_stdin);
|
||||
rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO, "<STDOUT>");
|
||||
rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO, "<STDIN>");
|
||||
rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
|
||||
rb_stderr = prep_stdio(stderr, FMODE_WRITABLE|FMODE_SYNC, rb_cIO, "<STDERR>");
|
||||
rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO, "<STDOUT>");
|
||||
rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter);
|
||||
rb_stderr = prep_stdio(stderr, FMODE_WRITABLE|FMODE_SYNC, rb_cIO, "<STDERR>");
|
||||
rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
|
||||
orig_stdout = rb_stdout;
|
||||
rb_deferr = orig_stderr = rb_stderr;
|
||||
|
@ -5576,10 +5576,9 @@ Init_IO(void)
|
|||
rb_define_global_const("STDOUT", rb_stdout);
|
||||
rb_define_global_const("STDERR", rb_stderr);
|
||||
|
||||
rb_define_readonly_variable("$<", &argf);
|
||||
argf = rb_obj_alloc(rb_cObject);
|
||||
rb_extend_object(argf, rb_mEnumerable);
|
||||
|
||||
rb_define_readonly_variable("$<", &argf);
|
||||
rb_define_global_const("ARGF", argf);
|
||||
|
||||
rb_define_singleton_method(argf, "to_s", argf_to_s, 0);
|
||||
|
@ -5619,8 +5618,8 @@ Init_IO(void)
|
|||
rb_define_singleton_method(argf, "lineno=", argf_set_lineno, 1);
|
||||
|
||||
rb_global_variable(¤t_file);
|
||||
filename = rb_str_new2("-");
|
||||
rb_define_readonly_variable("$FILENAME", &filename);
|
||||
filename = rb_str_new2("-");
|
||||
|
||||
rb_define_virtual_variable("$-i", opt_i_get, opt_i_set);
|
||||
|
||||
|
|
2
object.c
2
object.c
|
@ -2524,8 +2524,8 @@ Init_Object(void)
|
|||
rb_cData = rb_define_class("Data", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cData);
|
||||
|
||||
ruby_top_self = rb_obj_alloc(rb_cObject);
|
||||
rb_global_variable(&ruby_top_self);
|
||||
ruby_top_self = rb_obj_alloc(rb_cObject);
|
||||
rb_define_singleton_method(ruby_top_self, "to_s", main_to_s, 0);
|
||||
|
||||
rb_cTrueClass = rb_define_class("TrueClass", rb_cObject);
|
||||
|
|
Loading…
Reference in a new issue