Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1393:576143941a76
modulemanager: Enabled access to the module API from plugin libraries
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 23 Jun 2009 02:15:04 +0500 |
parent | 1392:9935ddfd8ccf |
child | 1394:2ebed659b958 |
comparison
equal
deleted
inserted
replaced
1392:9935ddfd8ccf | 1393:576143941a76 |
---|---|
404 local f, n = pluginloader.load_code(self.name, lib..".lib.lua"); | 404 local f, n = pluginloader.load_code(self.name, lib..".lib.lua"); |
405 if not f then | 405 if not f then |
406 f, n = pluginloader.load_code(lib, lib..".lib.lua"); | 406 f, n = pluginloader.load_code(lib, lib..".lib.lua"); |
407 end | 407 end |
408 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message | 408 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message |
409 setfenv(f, setmetatable({ module = self }, { __index = _G })); | |
409 return f(); | 410 return f(); |
410 end | 411 end |
411 | 412 |
412 -------------------------------------------------------------------- | 413 -------------------------------------------------------------------- |
413 | 414 |