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

Reported by @boycook
print-window-tiddler
Jeremy Ruston 2013-07-03 18:36:51 +01:00
rodzic 53a23cae5c
commit f28684d249
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -551,7 +551,10 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
if(!moduleInfo.exports) {
try {
// 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);
} else { // Object
moduleInfo.exports = moduleInfo.definition;