From 7d2ad6d6556da03300a5aeadeeacaec563435773 Mon Sep 17 00:00:00 2001 From: Florian Frank Date: Thu, 2 Jun 2016 21:10:36 +0200 Subject: Remove quirks mode --- lib/json/common.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/json/common.rb') diff --git a/lib/json/common.rb b/lib/json/common.rb index c47938f..209c3e7 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -295,13 +295,13 @@ module JSON # The global default options for the JSON.load method: # :max_nesting: false # :allow_nan: true - # :quirks_mode: true + # :allow_null: true attr_accessor :load_default_options end self.load_default_options = { :max_nesting => false, :allow_nan => true, - :quirks_mode => true, + :allow_null => true, :create_additions => true, } @@ -328,7 +328,7 @@ module JSON elsif source.respond_to?(:read) source = source.read end - if opts[:quirks_mode] && (source.nil? || source.empty?) + if opts[:allow_null] && (source.nil? || source.empty?) source = 'null' end result = parse(source, opts) @@ -357,13 +357,12 @@ module JSON # The global default options for the JSON.dump method: # :max_nesting: false # :allow_nan: true - # :quirks_mode: true + # :allow_null: true attr_accessor :dump_default_options end self.dump_default_options = { :max_nesting => false, :allow_nan => true, - :quirks_mode => true, } # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns -- cgit v1.2.1