File tree 2 files changed +3
-2
lines changed 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changes
2
2
3
3
* Numerous performance optimizations in ` JSON.generate ` and ` JSON.dump ` .
4
+ * Fix json-pure's ` Object#to_json ` to accept non state arguments
4
5
* Fix multiline comment support in ` json-pure ` .
5
6
* Fix ` JSON.parse ` to no longer mutate the argument encoding when passed an ASCII-8BIT string.
6
7
* Fix ` String#to_json ` to raise on invalid encoding in ` json-pure ` .
Original file line number Diff line number Diff line change @@ -378,8 +378,8 @@ module Object
378
378
# Converts this object to a string (calling #to_s), converts
379
379
# it to a JSON string, and returns the result. This is a fallback, if no
380
380
# special method #to_json was defined for some object.
381
- def to_json ( generator_state )
382
- if generator_state . strict?
381
+ def to_json ( state = nil , * )
382
+ if state && State . from_state ( state ) . strict?
383
383
raise GeneratorError , "#{ self . class } not allowed in JSON"
384
384
else
385
385
to_s . to_json
You can’t perform that action at this time.
0 commit comments