2013-07-08 01:04:13 -04:00
|
|
|
try {
|
|
|
|
this['Module'] = Module;
|
|
|
|
Module.test;
|
|
|
|
} catch(e) {
|
|
|
|
this['Module'] = Module = {};
|
|
|
|
}
|
2015-12-06 19:44:33 -05:00
|
|
|
if (typeof process === 'object') {
|
|
|
|
Module['preRun'] = Module['preRun'] || [];
|
|
|
|
Module['preRun'].push(function() {
|
|
|
|
FS.init();
|
|
|
|
FS.mkdir('/test-data');
|
|
|
|
FS.mount(NODEFS, { root: '.' }, '/test-data');
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
Module['print'] = function(x) {
|
|
|
|
var event = new Event('test-output');
|
|
|
|
event.data = x;
|
|
|
|
window.dispatchEvent(event);
|
|
|
|
};
|
|
|
|
}
|