浏览代码

Fix code style and missing break

Arseny Kapoulkine 4 年之前
父节点
当前提交
cee66d3932
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 4 3
      examples/js/loaders/GLTFLoader.js
  2. 4 3
      examples/jsm/loaders/GLTFLoader.js

+ 4 - 3
examples/js/loaders/GLTFLoader.js

@@ -279,19 +279,20 @@ THREE.GLTFLoader = ( function () {
 						case EXTENSIONS.EXT_MESHOPT_COMPRESSION:
 							if ( extensionsRequired.includes( extensionName ) ) {
 
-								if ( !this.meshoptDecoder ) {
+								if ( ! this.meshoptDecoder ) {
 
 									throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );	
 
 								}
 
-								if ( !this.meshoptDecoder.supported ) {
+								if ( ! this.meshoptDecoder.supported ) {
 
 									throw new Error( 'THREE.GLTFLoader: MeshoptDecoder support is required to load compressed files' );	
 
 								}
 
 							}
+							break;
 
 						default:
 
@@ -759,7 +760,7 @@ THREE.GLTFLoader = ( function () {
 			var buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );
 			var decoder = this.parser.options.meshoptDecoder;
 
-			if ( !decoder || !decoder.supported ) {
+			if ( ! decoder || ! decoder.supported ) {
 
 				return null; // will use the fallback buffer if present
 

+ 4 - 3
examples/jsm/loaders/GLTFLoader.js

@@ -342,19 +342,20 @@ var GLTFLoader = ( function () {
 						case EXTENSIONS.EXT_MESHOPT_COMPRESSION:
 							if ( extensionsRequired.includes( extensionName ) ) {
 
-								if ( !this.meshoptDecoder ) {
+								if ( ! this.meshoptDecoder ) {
 
 									throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );	
 
 								}
 
-								if ( !this.meshoptDecoder.supported ) {
+								if ( ! this.meshoptDecoder.supported ) {
 
 									throw new Error( 'THREE.GLTFLoader: MeshoptDecoder support is required to load compressed files' );	
 
 								}
 
 							}
+							break;
 
 						default:
 
@@ -822,7 +823,7 @@ var GLTFLoader = ( function () {
 			var buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );
 			var decoder = this.parser.options.meshoptDecoder;
 
-			if ( !decoder || !decoder.supported ) {
+			if ( ! decoder || ! decoder.supported ) {
 
 				return null; // will use the fallback buffer if present