1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-25 21:15:42 -07:00
libsodium/test/default/pre.js.inc

23 lines
563 B
PHP
Raw Normal View History

try {
this['Module'] = Module;
Module.test;
} catch(e) {
this['Module'] = Module = {};
}
if (typeof process === 'object') {
if (typeof(FS) === '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);
};
}