Prioritize "module.exports" over "exports" in require sandbox

(Node-ism, inherited (temporarily?) to support codemirror upgrade)
print-window-tiddler
natecain 2014-05-06 23:31:57 +02:00
rodzic 51f54b06f9
commit 6b03789e06
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -677,6 +677,9 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
} else if(typeof moduleInfo.definition === "string") { // String
moduleInfo.exports = _exports;
$tw.utils.evalSandboxed(moduleInfo.definition,sandbox,tiddler.fields.title);
if(sandbox.module.exports) {
moduleInfo.exports = sandbox.module.exports; //more codemirror workaround
}
} else { // Object
moduleInfo.exports = moduleInfo.definition;
}