add JSX_FORCE_MAPS flag for forcing decoding to maps
This commit is contained in:
parent
8e75e0f312
commit
cdd01c6eac
5 changed files with 30 additions and 8 deletions
|
@ -3,9 +3,13 @@ Def0 = case erlang:is_builtin(erlang, binary_to_integer, 1) andalso
|
|||
true -> [];
|
||||
false -> [{d, no_binary_to_whatever}]
|
||||
end,
|
||||
Defs = case erlang:is_builtin(erlang, is_map, 1) of
|
||||
Def1 = case erlang:is_builtin(erlang, is_map, 1) of
|
||||
true -> [{d, maps_support}|Def0];
|
||||
false -> Def0
|
||||
end,
|
||||
Defs = case os:getenv("JSX_FORCE_MAPS") of
|
||||
false -> Def1;
|
||||
_ -> [{d, maps_always}|Def1]
|
||||
end,
|
||||
lists:keystore(erl_opts, 1, CONFIG,
|
||||
{erl_opts, proplists:get_value(erl_opts, CONFIG, []) ++ Defs}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue