diff options
Diffstat (limited to 'platform/javascript/engine.js')
-rw-r--r-- | platform/javascript/engine.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index e6fb48d0d2..c54ccef1eb 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -1,3 +1,4 @@ + exposedLibs['FS'] = FS; return Module; }, }; @@ -31,6 +32,8 @@ this.rtenv = null; + var LIBS = {}; + var initPromise = null; var unloadAfterInit = true; @@ -80,7 +83,7 @@ return new Promise(function(resolve, reject) { rtenvProps.onRuntimeInitialized = resolve; rtenvProps.onAbort = reject; - rtenvProps.engine.rtenv = Engine.RuntimeEnvironment(rtenvProps); + rtenvProps.engine.rtenv = Engine.RuntimeEnvironment(rtenvProps, LIBS); }); } @@ -163,7 +166,7 @@ this.rtenv.thisProgram = executableName || getBaseName(basePath); preloadedFiles.forEach(function(file) { - this.rtenv.FS.createDataFile('/', file.name, new Uint8Array(file.buffer), true, true, true); + LIBS.FS.createDataFile('/', file.name, new Uint8Array(file.buffer), true, true, true); }, this); preloadedFiles = null; |