diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-05-08 16:55:01 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-05-10 18:22:48 +0200 |
commit | d2eef397312d1c142d95c2aef0ff3d5aeee6495a (patch) | |
tree | 3d5564f2769337c4eee0899d245b246e526ea542 /platform/javascript/engine/engine.js | |
parent | 7411e7fd37eb169b0f0675d4e4c2ec28786aec1b (diff) | |
download | redot-engine-d2eef397312d1c142d95c2aef0ff3d5aeee6495a.tar.gz |
Fix Closure compiler build, python style.
Move copyToFS into utils.js library included with '--pre-js'.
Diffstat (limited to 'platform/javascript/engine/engine.js')
-rw-r--r-- | platform/javascript/engine/engine.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/engine/engine.js b/platform/javascript/engine/engine.js index aecc6b9432..d709422abb 100644 --- a/platform/javascript/engine/engine.js +++ b/platform/javascript/engine/engine.js @@ -82,7 +82,7 @@ Function('return this')()['Engine'] = (function() { var me = this; return me.init().then(function() { if (!me.rtenv) { - reject(new Error('The engine must be initialized before it can be started')); + return Promise.reject(new Error('The engine must be initialized before it can be started')); } if (!(me.canvas instanceof HTMLCanvasElement)) { @@ -124,7 +124,7 @@ Function('return this')()['Engine'] = (function() { } return new Promise(function(resolve, reject) { preloader.preloadedFiles.forEach(function(file) { - Utils.copyToFS(me.rtenv['FS'], file.path, file.buffer); + me.rtenv['copyToFS'](file.path, file.buffer); }); preloader.preloadedFiles.length = 0; // Clear memory me.rtenv['callMain'](args); @@ -217,7 +217,7 @@ Function('return this')()['Engine'] = (function() { if (this.rtenv == null) { throw new Error("Engine must be inited before copying files"); } - Utils.copyToFS(this.rtenv['FS'], path, buffer); + this.rtenv['copyToFS'](path, buffer); } // Closure compiler exported engine methods. |