summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-04-15 13:34:03 +0900
committerHiroshi SHIBATA <[email protected]>2025-04-15 16:48:20 +0900
commit62b7ae955a1fba88a4f70e270b1e118cc6c0d778 (patch)
treeef957196b40f16c7c0c9f81900f840a66a5086c7 /ext/json
parentb8b4c15695ac4053b9d6c203e3948ea545be726b (diff)
[ruby/json] Don't create custom NaN and Infinity objects.
https://github.com/ruby/json/commit/ff8e18392d
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/lib/json/common.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index a542bdb361..91c89ef230 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -48,7 +48,7 @@ module JSON
end
end
- # TODO: exact :create_additions support to another gem for version 3.0
+ # TODO: exctract :create_additions support to another gem for version 3.0
def create_additions_proc(opts)
if opts[:symbolize_names]
raise ArgumentError, "options :symbolize_names and :create_additions cannot be used in conjunction"
@@ -220,9 +220,9 @@ module JSON
Thread.current[:"JSON.create_id"] || 'json_class'
end
- NaN = 0.0/0
+ NaN = Float::NAN
- Infinity = 1.0/0
+ Infinity = Float::INFINITY
MinusInfinity = -Infinity