From 72ab8739a295b5070f627fad14a5685c932906eb Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Dec 2017 21:27:50 +0100 Subject: [PATCH] Javascript tests: don't call FS.*() if the filesystem module is not present --- test/default/pre.js.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/default/pre.js.inc b/test/default/pre.js.inc index 130c1371..8b8d589a 100755 --- a/test/default/pre.js.inc +++ b/test/default/pre.js.inc @@ -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');