File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -600,9 +600,17 @@ defmodule System do
600
600
"""
601
601
# TODO: Once Erlang/OTP 23 is required, remove conditional, and update @doc accordingly.
602
602
# The warning is emitted by the compiler - so a @doc annotation is enough
603
+ # Note Elixir may be compiled in an earlier Erlang version but runs on a
604
+ # newer one, so we need the check at compilation time and runtime.
603
605
@ doc deprecated: "Use __STACKTRACE__ instead"
604
606
if function_exported? ( :erlang , :get_stacktrace , 0 ) do
605
- def stacktrace , do: apply ( :erlang , :get_stacktrace , [ ] )
607
+ def stacktrace do
608
+ if function_exported? ( :erlang , :get_stacktrace , 0 ) do
609
+ apply ( :erlang , :get_stacktrace , [ ] )
610
+ else
611
+ [ ]
612
+ end
613
+ end
606
614
else
607
615
def stacktrace , do: [ ]
608
616
end
You can’t perform that action at this time.
0 commit comments