From e8c46f4ca5e6ba2638fbfc81fdb9d141cd88e99a Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 26 Mar 2025 15:19:26 +0100 Subject: [ruby/json] JSON.load invoke the proc callback directly from the parser. And substitute the return value like `Marshal.load` doesm which I can only assume was the intent. This also open the door to re-implement all the `create_addition` logic in `json/common.rb`. https://github.com/ruby/json/commit/73d2137fd3 --- test/json/json_common_interface_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/json/json_common_interface_test.rb') diff --git a/test/json/json_common_interface_test.rb b/test/json/json_common_interface_test.rb index 96f7ccdf92..3f4f27439d 100644 --- a/test/json/json_common_interface_test.rb +++ b/test/json/json_common_interface_test.rb @@ -110,7 +110,7 @@ class JSONCommonInterfaceTest < Test::Unit::TestCase def test_load_with_proc visited = [] - JSON.load('{"foo": [1, 2, 3], "bar": {"baz": "plop"}}', proc { |o| visited << JSON.dump(o) }) + JSON.load('{"foo": [1, 2, 3], "bar": {"baz": "plop"}}', proc { |o| visited << JSON.dump(o); o }) expected = [ '"foo"', -- cgit v1.2.3