mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-26 08:11:09 +00:00
21 lines
498 B
PHP
21 lines
498 B
PHP
|
try {
|
||
|
this['Module'] = Module;
|
||
|
Module.test;
|
||
|
} catch(e) {
|
||
|
this['Module'] = Module = {};
|
||
|
}
|
||
|
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);
|
||
|
};
|
||
|
}
|