Fix ensure_class_loaded in Catalyst::ScriptRole
authorAndrew Rodland <andrew@cleverdomain.org>
Sun, 19 Mar 2017 20:07:02 +0000 (16:07 -0400)
committerAndrew Rodland <andrew@cleverdomain.org>
Sun, 19 Mar 2017 20:07:02 +0000 (16:07 -0400)
commitc8e0714d610f48f0f65c7ea148595a705c8c1cb2
treeead22849108b17ff7d845eaaf6deaed127cef945
parent59e4fb5d7e98d588779a88e791af881ad8e953df
Fix ensure_class_loaded in Catalyst::ScriptRole

it was trying to import ensure_class_loaded from Catalyst::Utils, but
Catalyst::Utils doesn't export. On current perls the import silently
fails, and the coercion for loader_class would have failed at runtime
if anyone actually tried to pass a non-loaded class as loader_class.
But with a sufficiently old version of UNIVERSAL it fails at compile
time instead (http://stackoverflow.com/q/42883017). Also the return
value of the via was 1, so no one could have ever been using this
thing. Fix it up.

While we're there, replace a usage of Class::Load::load_class with
ensure_class_loaded, because we don't really need two.
lib/Catalyst/ScriptRole.pm