mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 19:47:20 +00:00
Prioritize "module.exports" over "exports" in require sandbox
(Node-ism, inherited (temporarily?) to support codemirror upgrade)
This commit is contained in:
parent
51f54b06f9
commit
6b03789e06
@ -677,6 +677,9 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
|||||||
} else if(typeof moduleInfo.definition === "string") { // String
|
} else if(typeof moduleInfo.definition === "string") { // String
|
||||||
moduleInfo.exports = _exports;
|
moduleInfo.exports = _exports;
|
||||||
$tw.utils.evalSandboxed(moduleInfo.definition,sandbox,tiddler.fields.title);
|
$tw.utils.evalSandboxed(moduleInfo.definition,sandbox,tiddler.fields.title);
|
||||||
|
if(sandbox.module.exports) {
|
||||||
|
moduleInfo.exports = sandbox.module.exports; //more codemirror workaround
|
||||||
|
}
|
||||||
} else { // Object
|
} else { // Object
|
||||||
moduleInfo.exports = moduleInfo.definition;
|
moduleInfo.exports = moduleInfo.definition;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user