@@ -358,7 +358,7 @@ eval_forms(Tree, Binding, OrigE, Opts) ->
358358 _ -> [Erl ]
359359 end ,
360360
361- ExternalHandler = eval_external_handler () ,
361+ ExternalHandler = { value , fun ? MODULE : eval_external_handler / 3 } ,
362362
363363 {value , Value , NewBinding } =
364364 try
@@ -387,8 +387,6 @@ eval_forms(Tree, Binding, OrigE, Opts) ->
387387
388388% % TODO: Remove conditional once we require Erlang/OTP 25+.
389389-if (? OTP_RELEASE >= 25 ).
390- eval_external_handler () -> {value , fun ? MODULE :eval_external_handler /3 }.
391-
392390eval_external_handler (Ann , FunOrModFun , Args ) ->
393391 try
394392 case FunOrModFun of
@@ -452,7 +450,11 @@ drop_common([], [{?MODULE, _, _, _} | T2], _ToDrop) -> T2;
452450drop_common ([], [_ | T2 ], true ) -> T2 ;
453451drop_common ([], T2 , _ ) -> T2 .
454452- else .
455- eval_external_handler () -> none .
453+ eval_external_handler (_Ann , FunOrModFun , Args ) ->
454+ case FunOrModFun of
455+ {Mod , Fun } -> apply (Mod , Fun , Args );
456+ Fun -> apply (Fun , Args )
457+ end .
456458- endif .
457459
458460% % Converts a quoted expression to Erlang abstract format
0 commit comments