diff options
author | Jean Boussier <[email protected]> | 2025-02-10 21:09:35 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-02-12 13:15:01 +0900 |
commit | 293ad8a4e974e3dffc1419b37c15748f02b1481e () | |
tree | a3e6c430a90b0069413e357e52fac047aba121c7 /ext/json | |
parent | 502bd6ba37b1820f5f5a0fe6bc9820797fddc0d6 (diff) |
Fix a compatibility issue with `MultiJson.dump(obj, pretty: true)`
Fix: https://.com/ruby/json/issues/748 `MultiJson` pass `State#to_h` as options, and the `as_json` property defaults to `false` but `false` wasn't accepted by the constructor.
-rw-r--r-- | ext/json/generator/generator.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1626,7 +1626,7 @@ static int configure_state_i(VALUE key, VALUE val, VALUE _arg) else if (key == sym_script_safe) { state->script_safe = RTEST(val); } else if (key == sym_escape_slash) { state->script_safe = RTEST(val); } else if (key == sym_strict) { state->strict = RTEST(val); } - else if (key == sym_as_json) { state->as_json = rb_convert_type(val, T_DATA, "Proc", "to_proc"); } return ST_CONTINUE; } |