From 27f22b29f866d5cd807e70289ab771dabc79207c Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 8 Sep 2022 09:44:14 +0200 Subject: [Web] Small fixes and enhancements. - "Definitive" fix for ENOENT randomly disappearing from emscripten. - Proper shutdown when setup fails. - Re-enable WebGL explicit buffer swap. - Re-enable optional per-pixel transparency. - Add type cast to make closure compiler happy. - Remove emscripten Safari WebGL workaround. - Improve AudioWorklet cleanup. --- platform/web/js/engine/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platform/web/js/engine/config.js') diff --git a/platform/web/js/engine/config.js b/platform/web/js/engine/config.js index 9c4b6c2012..41be7b2512 100644 --- a/platform/web/js/engine/config.js +++ b/platform/web/js/engine/config.js @@ -317,7 +317,8 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused- if (!(this.canvas instanceof HTMLCanvasElement)) { const nodes = document.getElementsByTagName('canvas'); if (nodes.length && nodes[0] instanceof HTMLCanvasElement) { - this.canvas = nodes[0]; + const first = nodes[0]; + this.canvas = /** @type {!HTMLCanvasElement} */ (first); } if (!this.canvas) { throw new Error('No canvas found in page'); -- cgit v1.2.3