Javascript tests: don't call FS.*() if the filesystem module is not present
This commit is contained in:
parent
eeb135010d
commit
f8ad9651f9
@ -5,12 +5,14 @@ try {
|
|||||||
this['Module'] = Module = {};
|
this['Module'] = Module = {};
|
||||||
}
|
}
|
||||||
if (typeof process === 'object') {
|
if (typeof process === 'object') {
|
||||||
Module['preRun'] = Module['preRun'] || [];
|
if (typeof(FS) === 'object') {
|
||||||
Module['preRun'].push(function() {
|
Module['preRun'] = Module['preRun'] || [];
|
||||||
FS.init();
|
Module['preRun'].push(function() {
|
||||||
FS.mkdir('/test-data');
|
FS.init();
|
||||||
FS.mount(NODEFS, { root: '.' }, '/test-data');
|
FS.mkdir('/test-data');
|
||||||
});
|
FS.mount(NODEFS, { root: '.' }, '/test-data');
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Module['print'] = function(x) {
|
Module['print'] = function(x) {
|
||||||
var event = new Event('test-output');
|
var event = new Event('test-output');
|
||||||
|
Loading…
Reference in New Issue
Block a user