зеркало из https://github.com/github/ruby.git
* eval.c (rb_method_missing): protect exception from within
"inspect". (ruby-bugs PR#1204) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
beb00bc582
Коммит
b6beb8d943
|
@ -1,3 +1,8 @@
|
|||
Sat Oct 25 09:18:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_method_missing): protect exception from within
|
||||
"inspect". (ruby-bugs PR#1204)
|
||||
|
||||
Fri Oct 24 23:26:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* hash.c (rb_hash_each): Hash#each should yield single value.
|
||||
|
|
13
eval.c
13
eval.c
|
@ -4716,6 +4716,7 @@ rb_method_missing(argc, argv, obj)
|
|||
char *format = 0;
|
||||
char *desc = "";
|
||||
NODE *cnode = ruby_current_node;
|
||||
int state;
|
||||
|
||||
if (argc == 0 || !SYMBOL_P(argv[0])) {
|
||||
rb_raise(rb_eArgError, "no id given");
|
||||
|
@ -4725,6 +4726,7 @@ rb_method_missing(argc, argv, obj)
|
|||
|
||||
id = SYM2ID(argv[0]);
|
||||
|
||||
|
||||
switch (TYPE(obj)) {
|
||||
case T_NIL:
|
||||
desc = "nil";
|
||||
|
@ -4736,16 +4738,17 @@ rb_method_missing(argc, argv, obj)
|
|||
desc = "false";
|
||||
break;
|
||||
default:
|
||||
if (rb_respond_to(obj, rb_intern("inspect")))
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
d = rb_inspect(obj);
|
||||
else
|
||||
}
|
||||
POP_TAG();
|
||||
if (!d || RSTRING(d)->len > 65) {
|
||||
d = rb_any_to_s(obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (d) {
|
||||
if (RSTRING(d)->len > 65) {
|
||||
d = rb_any_to_s(obj);
|
||||
}
|
||||
desc = RSTRING(d)->ptr;
|
||||
}
|
||||
|
||||
|
|
12
version.h
12
version.h
|
@ -1,11 +1,11 @@
|
|||
#define RUBY_VERSION "1.8.0"
|
||||
#define RUBY_RELEASE_DATE "2003-10-24"
|
||||
#define RUBY_VERSION_CODE 180
|
||||
#define RUBY_RELEASE_CODE 20031024
|
||||
#define RUBY_VERSION "1.8.1"
|
||||
#define RUBY_RELEASE_DATE "2003-10-25"
|
||||
#define RUBY_VERSION_CODE 181
|
||||
#define RUBY_RELEASE_CODE 20031025
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 8
|
||||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_VERSION_TEENY 1
|
||||
#define RUBY_RELEASE_YEAR 2003
|
||||
#define RUBY_RELEASE_MONTH 10
|
||||
#define RUBY_RELEASE_DAY 24
|
||||
#define RUBY_RELEASE_DAY 25
|
||||
|
|
Загрузка…
Ссылка в новой задаче