Javascript tests: don't call FS.*() if the filesystem module is not present

This commit is contained in:
Frank Denis 2017-12-21 21:27:50 +01:00
parent eeb135010d
commit f8ad9651f9

View File

@ -5,12 +5,14 @@ try {
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');