Sfoglia il codice sorgente

Safely check for XRWebGLBinding (#30319)

ZonkyPop 1 anno fa
parent
commit
2cf6a5bfd3
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/renderers/webxr/WebXRManager.js

+ 1 - 1
src/renderers/webxr/WebXRManager.js

@@ -277,7 +277,7 @@ class WebXRManager extends EventDispatcher {
 
 				// Check that the browser implements the necessary APIs to use an
 				// XRProjectionLayer rather than an XRWebGLLayer
-				const useLayers = XRWebGLBinding !== undefined && 'createProjectionLayer' in XRWebGLBinding.prototype;
+				const useLayers = typeof XRWebGLBinding !== 'undefined' && 'createProjectionLayer' in XRWebGLBinding.prototype;
 
 				if ( ! useLayers ) {
 

粤ICP备19079148号