From 6b03789e06364c0f0ea2ac8a13a4bce895a91458 Mon Sep 17 00:00:00 2001 From: natecain Date: Tue, 6 May 2014 23:31:57 +0200 Subject: [PATCH] Prioritize "module.exports" over "exports" in require sandbox (Node-ism, inherited (temporarily?) to support codemirror upgrade) --- boot/boot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot/boot.js b/boot/boot.js index c08acdcac..d937246e4 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -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; }