From 6769dd64fc5430e8c34295cb41434bff734a5155 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 21 Sep 2020 13:55:30 +0200 Subject: [PATCH] [HTML5] Expose request_quit via Engine class. So it can be called when closure compiler is enabled. --- platform/javascript/engine/engine.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/javascript/engine/engine.js b/platform/javascript/engine/engine.js index adcd919a6b2..f8e216db2d7 100644 --- a/platform/javascript/engine/engine.js +++ b/platform/javascript/engine/engine.js @@ -227,6 +227,12 @@ Function('return this')()['Engine'] = (function() { this.persistentPaths = persistentPaths; }; + Engine.prototype.requestQuit = function() { + if (this.rtenv) { + this.rtenv['request_quit'](); + } + }; + // Closure compiler exported engine methods. /** @export */ Engine['isWebGLAvailable'] = Utils.isWebGLAvailable; @@ -249,5 +255,6 @@ Function('return this')()['Engine'] = (function() { Engine.prototype['setOnExit'] = Engine.prototype.setOnExit; Engine.prototype['copyToFS'] = Engine.prototype.copyToFS; Engine.prototype['setPersistentPaths'] = Engine.prototype.setPersistentPaths; + Engine.prototype['requestQuit'] = Engine.prototype.requestQuit; return Engine; })();