File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -493,20 +493,20 @@ def foo.to_h
493493 assert_equal '2' , state . indent
494494 end
495495
496- if defined? ( JSON ::Ext ::Generator ) and RUBY_PLATFORM != "java"
497- def test_broken_bignum # [ruby-core:38867]
498- bignum = 1 << 64
499- original_to_s = bignum . class . instance_method ( :to_s )
500- bignum . class . class_eval do
501- def to_s
502- end
503- end
504- assert_raise ( TypeError ) do
505- JSON ::Ext ::Generator ::State . new . generate ( bignum )
496+ def test_broken_bignum # [Bug #5173]
497+ bignum = 1 << 64
498+ original_to_s = bignum . class . instance_method ( :to_s )
499+ bignum . class . class_eval do
500+ def to_s
501+ nil
506502 end
507- ensure
508- bignum . class . define_method ( :to_s , original_to_s ) if original_to_s
503+ alias_method :to_s , :to_s
504+ end
505+ assert_raise ( TypeError ) do
506+ JSON ::Ext ::Generator ::State . new . generate ( bignum )
509507 end
508+ ensure
509+ bignum . class . define_method ( :to_s , original_to_s ) if original_to_s
510510 end
511511
512512 def test_hash_likeness_set_symbol
You can’t perform that action at this time.
0 commit comments