Jelajahi Sumber

HelioWebXRPolyfill clean up.

Mr.doob 5 tahun lalu
induk
melakukan
ad47577bf8
1 mengubah file dengan 9 tambahan dan 8 penghapusan
  1. 9 8
      examples/js/vr/HelioWebXRPolyfill.js

+ 9 - 8
examples/js/vr/HelioWebXRPolyfill.js

@@ -2,10 +2,11 @@
  * @author mvilledieu / http://github.com/mvilledieu
  */
 
-if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {
+if ( /(Helio)/g.test( navigator.userAgent ) && 'xr' in navigator ) {
+
 	console.log( "Helio WebXR Polyfill (Lumin 0.98.0)" );
 
-	if ('isSessionSupported' in navigator.xr) {
+	if ( 'isSessionSupported' in navigator.xr ) {
 
 		const tempIsSessionSupported = navigator.xr.isSessionSupported.bind( navigator.xr );
 
@@ -18,7 +19,7 @@ if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {
 
 	}
 
-	if ('isSessionSupported' in navigator.xr && "requestSession" in navigator.xr) {
+	if ( 'isSessionSupported' in navigator.xr && 'requestSession' in navigator.xr ) {
 
 		const tempRequestSession = navigator.xr.requestSession.bind( navigator.xr );
 
@@ -28,19 +29,19 @@ if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {
 
 				var sessionInit = { optionalFeatures: [ 'local-floor', 'bounded-floor' ] };
 
-				tempRequestSession( 'immersive-ar', sessionInit).then(function ( session ) {
+				tempRequestSession( 'immersive-ar', sessionInit ).then( function ( session ) {
 
 					resolve( session );
 
-				}).catch( function ( error ) {
+				} ).catch( function ( error ) {
 
 					return reject( error );
 
-				});
+				} );
 
-			});
+			} );
 
-		}
+		};
 
 	}