What's Changed
- Improve
JSON.loadandJSON.unsafe_loadto allow passing options as second argument. - Fix the parser to no longer ignore invalid escapes in strings.
Only\",\\,\b,\f,\n,\r,\tand\uare valid JSON escapes. - Fixed
JSON::Coderto use the depth it was initialized with. - On TruffleRuby, fix the generator to not call
to_jsonon the return value ofas_jsonforFloat::NAN. - Fixed handling of
state.depth: whento_jsonchangesstate.depthbut does not restore it, it is reset
automatically to its initial value.
In particular, when aNestingErroris raised,depthis no longer equal tomax_nestingafter the call to
generate, and is reset to its initial value. Similarly whento_jsonraises an exception.
Full Changelog: v2.16.0...v2.17.0