summaryrefslogtreecommitdiff
path: root/ext/json/generator
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2024-10-17 14:55:18 +0200
committergit <[email protected]>2024-10-17 13:02:13 +0000
commitdf48f597cfe7be7e2aa27a886f67a021e2d6cd5f (patch)
tree0e9cea19fef3e94613194162a56340b03f5cf880 /ext/json/generator
parent6105bae331aa8a804ffa762735e8647507f85179 (diff)
[ruby/json] Get rid of some more outdated compatibility code
All these macros are available on Ruby 2.3+ https://github.com/ruby/json/commit/227885f460
Diffstat (limited to 'ext/json/generator')
-rw-r--r--ext/json/generator/generator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 576ab4e9c9..0af1592a70 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -620,9 +620,9 @@ static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_St
VALUE tmp = rb_funcall(obj, i_to_s, 0);
if (!allow_nan) {
if (isinf(value)) {
- rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", RB_OBJ_STRING(tmp));
+ rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", tmp);
} else if (isnan(value)) {
- rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", RB_OBJ_STRING(tmp));
+ rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", tmp);
}
}
fbuffer_append_str(buffer, tmp);
@@ -670,7 +670,7 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
default:
general:
if (state->strict) {
- rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", RB_OBJ_STRING(CLASS_OF(obj)));
+ rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", CLASS_OF(obj));
} else if (rb_respond_to(obj, i_to_json)) {
tmp = rb_funcall(obj, i_to_json, 1, Vstate);
Check_Type(tmp, T_STRING);