Closed casperisfine closed 3 weeks ago
For the ActiveSupport use case in https://github.com/ruby/json/issues/667 maybe this extra escaping should/could be a JSON.dump option? Then maybe we wouldn't need to treat subclasses any specially. Or EscapedString wouldn't inherit from String, seems even simpler/clearer.
I created a self contained test case to more easily test historical behavior, and it seems we already diverged: https://gist.github.com/casperisfine/a379245862b0d5273086e5053657460a
I'll update the test suite to have the same behavior as 2.7.2
Ref: https://github.com/ruby/json/pull/674 Ref: https://github.com/ruby/json/pull/668
The behavior on such case it quite unclear, the goal here is to figure out whatever was the behavior on Cext version of
json 2.7.0
and get all implementations to converge.We can then decide to make them all behave differently if we so wish.
FYI: @eregon