niti: use get_mmodule_by_name instead of the low-level load_module
authorJean Privat <jean@pryen.org>
Thu, 4 Dec 2014 03:00:19 +0000 (22:00 -0500)
committerJean Privat <jean@pryen.org>
Sat, 6 Dec 2014 03:50:18 +0000 (22:50 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/nit.nit

index 3785ff5..5e8697d 100644 (file)
@@ -51,12 +51,11 @@ if opt_eval.value then
 
        var parent = null
        if opt_loop.value then
-               var nruntime = modelbuilder.load_module("niti_runtime")
-               if nruntime == null then
+               parent = modelbuilder.get_mmodule_by_name(null, null, "niti_runtime")
+               if parent == null then
                        toolcontext.check_errors
                        abort
                end
-               parent = nruntime.mmodule
        end
 
        modelbuilder.load_rt_module(parent, amodule, "-")