Diff

core/moduleapi.lua @ 6415:010b141e91ed

core.modulemanager, core.moduleapi: Hack around dependency loop
author Kim Alvefur <zash@zash.se>
date Wed, 17 Sep 2014 14:48:49 +0200
parent 6414:31c15004bfb0
child 6418:ae798314347c
child 6422:6d4d87a89026
line wrap: on
line diff
--- a/core/moduleapi.lua	Wed Sep 17 14:47:52 2014 +0200
+++ b/core/moduleapi.lua	Wed Sep 17 14:48:49 2014 +0200
@@ -7,7 +7,7 @@
 --
 
 local config = require "core.configmanager";
-local modulemanager = require "modulemanager"; -- This is necessary to avoid require loops
+local modulemanager; -- This gets set from modulemanager
 local array = require "util.array";
 local set = require "util.set";
 local logger = require "util.logger";
@@ -370,4 +370,7 @@
 	return require"core.storagemanager".open(self.host, name or self.name, type);
 end
 
-return api;
+return function (mm)
+	modulemanager = mm;
+	return api;
+end