switch to feature detection rather than trying to figure out from
compiler version/release whether maps should be supported
This commit is contained in:
parent
4d058d1616
commit
6089de017c
2 changed files with 8 additions and 5 deletions
1
config/maps
Normal file
1
config/maps
Normal file
|
@ -0,0 +1 @@
|
||||||
|
maps:keys(#{0 => false, 1 => true}) == [0,1].
|
|
@ -1,6 +1,8 @@
|
||||||
application:start(compiler),
|
case os:getenv("JSX_NOMAPS") of
|
||||||
case {erlang:system_info(version), application:get_key(compiler, vsn), os:getenv("JSX_NO_MAPS")} of
|
false ->
|
||||||
{X, {ok, Y}, false} when X >= "6.0" andalso Y >= "5.0" ->
|
try file:script("config/maps") of {ok, true} ->
|
||||||
CONFIG ++ [{erl_opts, [{d, release_supports_maps}]}];
|
[{d, release_supports_maps}] ++ CONFIG
|
||||||
|
catch _:_ -> CONFIG
|
||||||
|
end;
|
||||||
_ -> CONFIG
|
_ -> CONFIG
|
||||||
end.
|
end.
|
Loading…
Add table
Add a link
Reference in a new issue