1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Fix problem with JavaScript module tiddlers that are named as system tiddlers

Reported by @boycook
This commit is contained in:
Jeremy Ruston 2013-07-03 18:36:51 +01:00
parent 53a23cae5c
commit f28684d249

View File

@ -551,7 +551,10 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
if(!moduleInfo.exports) { if(!moduleInfo.exports) {
try { try {
// Check the type of the definition // Check the type of the definition
if(typeof moduleInfo.definition === "string") { // String if(typeof moduleInfo.definition === "function") { // Function
moduleInfo.exports = {};
moduleInfo.definition(moduleInfo,moduleInfo.exports,sandbox.require);
} else if(typeof moduleInfo.definition === "string") { // String
moduleInfo.exports = $tw.utils.evalSandboxed(moduleInfo.definition,sandbox,tiddler.fields.title); moduleInfo.exports = $tw.utils.evalSandboxed(moduleInfo.definition,sandbox,tiddler.fields.title);
} else { // Object } else { // Object
moduleInfo.exports = moduleInfo.definition; moduleInfo.exports = moduleInfo.definition;