diff options
author | Florian Frank <flori@ping.de> | 2016-06-02 21:10:36 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2016-06-02 21:11:23 +0200 |
commit | 7d2ad6d6556da03300a5aeadeeacaec563435773 (patch) | |
tree | bdf346367cb20685f8001fc2091e00b6a84a22fe /lib/json/common.rb | |
parent | a985a0c4b074280e2a9e215ead95b1e66797b6c3 (diff) | |
download | json-7d2ad6d6556da03300a5aeadeeacaec563435773.tar.gz |
Remove quirks mode
Diffstat (limited to 'lib/json/common.rb')
-rw-r--r-- | lib/json/common.rb | 9 |
1 files changed, 4 insertions, 5 deletions
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 |