瀏覽代碼

[HTML5] Expose request_quit via Engine class.

So it can be called when closure compiler is enabled.
Fabio Alessandrelli 5 年之前
父節點
當前提交
6769dd64fc
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      platform/javascript/engine/engine.js

+ 7 - 0
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;
 })();