ruby-changes:39043
From: usa <ko1@a...>
Date: Fri, 3 Jul 2015 19:15:37 +0900 (JST)
Subject: [ruby-changes:39043] usa:r51124 (ruby_2_1): merge revision(s) 49235: [Backport #10711]
usa 2015-07-03 19:15:22 +0900 (Fri, 03 Jul 2015) New Revision: 51124 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51124 Log: merge revision(s) 49235: [Backport #10711] numeric.c: fix message * numeric.c (coerce_failed): fix the error message on non-flonum platforms. Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/numeric.c branches/ruby_2_1/version.h Index: ruby_2_1/numeric.c =================================================================== --- ruby_2_1/numeric.c (revision 51123) +++ ruby_2_1/numeric.c (revision 51124) @@ -236,9 +236,14 @@ NORETURN(static void coerce_failed(VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_1/numeric.c#L236 static void coerce_failed(VALUE x, VALUE y) { + if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) { + y = rb_inspect(y); + } + else { + y = rb_obj_class(y); + } rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE, - (rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)), - rb_obj_class(x)); + y, rb_obj_class(x)); } static VALUE Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 51123) +++ ruby_2_1/version.h (revision 51124) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.7" #define RUBY_RELEASE_DATE "2015-07-03" -#define RUBY_PATCHLEVEL 374 +#define RUBY_PATCHLEVEL 375 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 7 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r49235 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/