ruby-changes:45796
From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 02:51:11 +0900 (JST)
Subject: [ruby-changes:45796] naruse:r57869 (ruby_2_4): merge revision(s) 57407: [Backport #13145]
naruse 2017-03-12 02:51:05 +0900 (Sun, 12 Mar 2017) New Revision: 57869 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57869 Log: merge revision(s) 57407: [Backport #13145] object.c: no TypeError at Symbol * object.c (special_object_p): uninterned Symbol also should not raise a TypeError but return itself instead, as well as interned Symbols. [ruby-core:79216] [Bug #13145] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/object.c branches/ruby_2_4/test/ruby/test_object.rb branches/ruby_2_4/version.h Index: ruby_2_4/test/ruby/test_object.rb =================================================================== --- ruby_2_4/test/ruby/test_object.rb (revision 57868) +++ ruby_2_4/test/ruby/test_object.rb (revision 57869) @@ -23,6 +23,8 @@ class TestObject < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_object.rb#L23 assert_equal true, true.dup assert_equal nil, nil.dup assert_equal false, false.dup + x = :x; assert_equal x, x.dup + x = "bug13145".intern; assert_equal x, x.dup x = 1 << 64; assert_equal x, x.dup x = 1.72723e-77; assert_equal x, x.dup @@ -51,6 +53,8 @@ class TestObject < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_object.rb#L53 assert_equal true, true.clone assert_equal nil, nil.clone assert_equal false, false.clone + x = :x; assert_equal x, x.dup + x = "bug13145".intern; assert_equal x, x.dup x = 1 << 64; assert_equal x, x.clone x = 1.72723e-77; assert_equal x, x.clone assert_raise(ArgumentError) {1.clone(freeze: false)} Index: ruby_2_4/object.c =================================================================== --- ruby_2_4/object.c (revision 57868) +++ ruby_2_4/object.c (revision 57869) @@ -304,6 +304,7 @@ special_object_p(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/object.c#L304 switch (BUILTIN_TYPE(obj)) { case T_BIGNUM: case T_FLOAT: + case T_SYMBOL: return TRUE; default: return FALSE; Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 57868) +++ ruby_2_4/version.h (revision 57869) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-12" -#define RUBY_PATCHLEVEL 34 +#define RUBY_PATCHLEVEL 35 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57407 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/