summaryrefslogtreecommitdiff
path: root/sys/external/isc/libsodium/dist/test/default/pre.js.inc
blob: 130c1371f231bef181db43f1146e2808bffaecbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
    };
}