mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext/json: backward compatibilities
* ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c: add macros for backward compatibilities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a1a237fb36
commit
cfa2a21062
2 changed files with 11 additions and 2 deletions
|
@ -812,10 +812,10 @@ static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_St
|
|||
if (!allow_nan) {
|
||||
if (isinf(value)) {
|
||||
fbuffer_free(buffer);
|
||||
rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
|
||||
rb_raise(eGeneratorError, "%u: %"PRIsVALUE" not allowed in JSON", __LINE__, RB_OBJ_STRING(tmp));
|
||||
} else if (isnan(value)) {
|
||||
fbuffer_free(buffer);
|
||||
rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
|
||||
rb_raise(eGeneratorError, "%u: %"PRIsVALUE" not allowed in JSON", __LINE__, RB_OBJ_STRING(tmp));
|
||||
}
|
||||
}
|
||||
fbuffer_append_str(buffer, tmp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue