serval-dna/libsodium/test/default/pre.js.inc
Andrew Bettison 63d5cec1c6 Merge libsodium 1.0.13
git subtree add --squash --prefix libsodium git@github.com:jedisct1/libsodium.git 1.0.13
git commit --amend (to rewrite this commit message)
2017-09-19 10:16:40 +09:30

21 lines
498 B
PHP
Executable File

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);
};
}