You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/12 07:21:38 UTC

[06/50] [abbrv] mochiweb commit: updated refs/heads/import-master to 3a54dbf

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


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/e708a7a6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/e708a7a6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/e708a7a6

Branch: refs/heads/import-master
Commit: e708a7a63f21d9155169ae772c755d8c85a92cfe
Parents: 5efc9db
Author: John Christopher Anderson <jc...@apache.org>
Authored: Sun Sep 21 13:23:11 2008 +0000
Committer: John Christopher Anderson <jc...@apache.org>
Committed: Sun Sep 21 13:23:11 2008 +0000

----------------------------------------------------------------------
 mochijson2.erl | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/e708a7a6/mochijson2.erl
----------------------------------------------------------------------
diff --git a/mochijson2.erl b/mochijson2.erl
index 6fa7499..668486f 100644
--- a/mochijson2.erl
+++ b/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) ->