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