fix ordering problem for pre_encode

This commit is contained in:
alisdair sullivan 2012-09-03 21:27:00 -07:00
parent 18bc21d838
commit 6bf3ff67e8

View file

@ -82,13 +82,14 @@ list_or_object([Term|Rest], {Handler, State}, Opts) ->
object([{Key, Value}, Next|Rest], {Handler, State}, Opts) when is_atom(Key); is_binary(Key) -> object([{Key, Value}, Next|Rest], {Handler, State}, Opts) when is_atom(Key); is_binary(Key) ->
object( V = pre_encode(Value, Opts),
object(
[pre_encode(Next, Opts)|Rest], [pre_encode(Next, Opts)|Rest],
{ {
Handler, Handler,
value( value(
pre_encode(Value, Opts), V,
{Handler, Handler:handle_event({key, clean_string(fix_key(Key), Opts)}, State)}, {Handler, Handler:handle_event({key, clean_string(fix_key(Key), Opts)}, State)},
Opts Opts
) )
}, },