Skip to content

Commit b3ba0ad

Browse files
authored
Partial revert of #25848 (#26172)
In #25848 I replaced a bunch of `typeof X` references with `globalThis.X`, but this instance should not have been replaced because in this case GL is a local the module, not a global.
1 parent 15e22a0 commit b3ba0ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/libhtml5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ var LibraryHTML5 = {
415415
$findCanvasEventTarget: (target) => {
416416
if (typeof target == 'number') target = UTF8ToString(target);
417417
if (!target || target === '#canvas') {
418-
if (globalThis.GL?.offscreenCanvases['canvas']) return GL.offscreenCanvases['canvas']; // TODO: Remove this line, target '#canvas' should refer only to Module['canvas'], not to GL.offscreenCanvases['canvas'] - but need stricter tests to be able to remove this line.
418+
if (typeof GL != 'undefined' && GL.offscreenCanvases['canvas']) return GL.offscreenCanvases['canvas']; // TODO: Remove this line, target '#canvas' should refer only to Module['canvas'], not to GL.offscreenCanvases['canvas'] - but need stricter tests to be able to remove this line.
419419
return Module['canvas'];
420420
}
421-
if (globalThis.GL?.offscreenCanvases[target]) return GL.offscreenCanvases[target];
421+
if (typeof GL != 'undefined' && GL.offscreenCanvases[target]) return GL.offscreenCanvases[target];
422422
return findEventTarget(target);
423423
},
424424
#endif

0 commit comments

Comments
 (0)