diff options
author | John Christopher Anderson <jchris@apache.org> | 2008-09-21 13:23:11 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2008-09-21 13:23:11 +0000 |
commit | 3cbb3a00d50acc3fabd597f9486a85713afe3c3a (patch) | |
tree | 0defc46e1e28f7d1f1423c346092cf17473c32db /src | |
parent | 9a93b44ef02014a6e269b70d8c29362a3e4b3afb (diff) |
change integer handling in mochijson2 to fix JSON regression COUCHDB-118
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@697512 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/mochiweb/mochijson2.erl | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mochiweb/mochijson2.erl b/src/mochiweb/mochijson2.erl index 6fa7499c..668486fc 100644 --- a/src/mochiweb/mochijson2.erl +++ b/src/mochiweb/mochijson2.erl @@ -93,11 +93,8 @@ json_encode(false, _State) -> <<"false">>; json_encode(null, _State) -> <<"null">>; -json_encode(I, _State) when is_integer(I) andalso I >= -2147483648 andalso I =< 2147483647 -> - %% Anything outside of 32-bit integers should be encoded as a float - integer_to_list(I); json_encode(I, _State) when is_integer(I) -> - mochinum:digits(float(I)); + integer_to_list(I); json_encode(F, _State) when is_float(F) -> mochinum:digits(F); json_encode(S, State) when is_binary(S); is_atom(S) -> |