Skip to content

Commit ff8e183

Browse files
committed
Don't create custom NaN and Infinity objects.
1 parent e109d94 commit ff8e183

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/json/common.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def array_class_proc(array_class, on_load)
4848
end
4949
end
5050

51-
# TODO: exact :create_additions support to another gem for version 3.0
51+
# TODO: exctract :create_additions support to another gem for version 3.0
5252
def create_additions_proc(opts)
5353
if opts[:symbolize_names]
5454
raise ArgumentError, "options :symbolize_names and :create_additions cannot be used in conjunction"
@@ -220,9 +220,9 @@ def self.create_id
220220
Thread.current[:"JSON.create_id"] || 'json_class'
221221
end
222222

223-
NaN = 0.0/0
223+
NaN = Float::NAN
224224

225-
Infinity = 1.0/0
225+
Infinity = Float::INFINITY
226226

227227
MinusInfinity = -Infinity
228228

0 commit comments

Comments
 (0)