ext/oj/mimic_json.c in oj-3.0.8 vs ext/oj/mimic_json.c in oj-3.0.9

- old
+ new

@@ -487,10 +487,11 @@ pi.options.allow_invalid = No; pi.options.empty_string = No; pi.options.create_ok = No; pi.options.allow_nan = (bang ? Yes : No); pi.options.nilnil = No; + pi.options.mode = CompatMode; pi.max_depth = 100; if (2 <= argc) { VALUE ropts = argv[1]; VALUE v; @@ -548,10 +549,14 @@ rb_raise(rb_eArgError, ":symbolize_names and :create_additions can not both be true."); } } *args = *argv; - return oj_pi_parse(1, args, &pi, 0, 0, 0); + if (T_STRING == rb_type(*args)) { + return oj_pi_parse(1, args, &pi, 0, 0, false); + } else { + return oj_pi_sparse(1, args, &pi, 0); + } } /* Document-method: parse * call-seq: parse(source, opts=nil) *