diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-07-27 16:19:50 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-07-28 09:39:12 +0900 |
| commit | 48a79cd4921e6f38facbea5fbb4b7ab6905a524d (patch) | |
| tree | 6a30564c54e81752b65d98133fafa2944ebbe360 /ext/json | |
| parent | d0020d58f468b83e69b0494ffa83990db8f18d45 (diff) | |
[ruby/json] Improve deprecation warning location detection
https://github.com/ruby/json/commit/132049bde2
Diffstat (limited to 'ext/json')
| -rw-r--r-- | ext/json/lib/json/common.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index 69e436f190..9a878cead9 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -96,7 +96,7 @@ module JSON end class << self - def deprecation_warning(message, uplevel = 4) # :nodoc: + def deprecation_warning(message, uplevel = 3) # :nodoc: gem_root = File.expand_path("../../../", __FILE__) + "/" caller_locations(uplevel, 10).each do |frame| if frame.path.nil? || frame.path.start_with?(gem_root) || frame.path.end_with?("/truffle/cext_ruby.rb", ".c") @@ -107,9 +107,9 @@ module JSON end if RUBY_VERSION >= "3.0" - warn(message, uplevel: uplevel - 1, category: :deprecated) + warn(message, uplevel: uplevel, category: :deprecated) else - warn(message, uplevel: uplevel - 1) + warn(message, uplevel: uplevel) end end |
