From 4935c676df759054b39d1daf4ca339eea5e052b0 Mon Sep 17 00:00:00 2001 From: Yuki Kurihara Date: Mon, 12 May 2025 07:06:48 +0000 Subject: [PATCH 1/3] Merge pull request #2366 from ksss/json-remove-deprecated-methods Remove deprecated methods in `JSON` --- stdlib/json/0/json.rbs | 52 +++----------- test/stdlib/json/JSONKernel_test.rb | 22 ------ test/stdlib/json/JSON_test.rb | 104 +--------------------------- 3 files changed, 11 insertions(+), 167 deletions(-) diff --git a/stdlib/json/0/json.rbs b/stdlib/json/0/json.rbs index 6d242c831..5750d9c5c 100644 --- a/stdlib/json/0/json.rbs +++ b/stdlib/json/0/json.rbs @@ -14,9 +14,6 @@ end class JSON::GeneratorError < JSON::JSONError end -class JSON::UnparserError < JSON::GeneratorError -end - # # This exception is raised if a parser error occurs. # @@ -754,6 +751,7 @@ module JSON # opts = JSON.dump_default_options # opts # => {:max_nesting=>false, :allow_nan=>true} # + %a{deprecated} def self.dump_default_options: () -> options # @@ -761,6 +759,7 @@ module JSON # opts = JSON.dump_default_options # opts # => {:max_nesting=>false, :allow_nan=>true} # + %a{deprecated} def self.dump_default_options=: (options) -> options # - # Encodes string using String.encode. - # - def self.iconv: (encoding to, encoding from, String string) -> String - # @@ -1010,6 +1000,7 @@ module JSON # opts = JSON.load_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} # + %a{deprecated} def self.load_default_options=: (options) -> options # - # - alias self.restore self.load - - # - # - alias restore load - # # Sets or Returns the JSON generator state class that is used by JSON. # @@ -1152,10 +1120,6 @@ module JSON # Sets or Returns the JSON generator state class that is used by JSON. # def self.state=: (state) -> state - - alias self.unparse self.generate - - alias unparse generate end JSON::FAST_STATE_PROTOTYPE: JSON::state @@ -1193,6 +1157,7 @@ module Kernel # Outputs *objs* to STDOUT as JSON strings in the shortest form, that is in one # line. # + %a{deprecated} def j: (*_ToJson) -> nil #