Skip to content

Commit

Permalink
raw (already encoded) objects pass right through
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay committed Feb 25, 2009
1 parent a9b1d90 commit 06ec5da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mochijson2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ json_encode(Array, State) when is_list(Array) ->
json_encode_array(Array, State);
json_encode({struct, Props}, State) when is_list(Props) ->
json_encode_proplist(Props, State);
json_encode({raw, EncodedString}, _State) when is_list(EncodedString) ->
list_to_binary(EncodedString);
json_encode({raw, EncodedBinary}, _State) when is_binary(EncodedBinary) ->
EncodedBinary;
json_encode(Bad, #encoder{handler=null}) ->
exit({json_encode, {bad_term, Bad}});
json_encode(Bad, State=#encoder{handler=Handler}) ->
Expand Down

0 comments on commit 06ec5da

Please sign in to comment.