mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Javascript tests: don't call FS.*() if the filesystem module is not present
This commit is contained in:
parent
bd631649c1
commit
72ab8739a2
@ -5,12 +5,14 @@ try {
|
||||
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');
|
||||
});
|
||||
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');
|
||||
|
Loading…
Reference in New Issue
Block a user