1
0
Эх сурвалжийг харах

Loaders: Make return types in `load()` consistent. (#33380)

Michael Herzog 2 өдөр өмнө
parent
commit
86bd3d50d1

+ 1 - 2
src/loaders/FileLoader.js

@@ -74,7 +74,6 @@ class FileLoader extends Loader {
 	 * @param {function(any)} onLoad - Executed when the loading process has been finished.
 	 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
 	 * @param {onErrorCallback} [onError] - Executed when errors occur.
-	 * @return {any|undefined} The cached resource if available.
 	 */
 	load( url, onLoad, onProgress, onError ) {
 
@@ -98,7 +97,7 @@ class FileLoader extends Loader {
 
 			}, 0 );
 
-			return cached;
+			return;
 
 		}
 

+ 1 - 6
src/loaders/ImageBitmapLoader.js

@@ -107,7 +107,6 @@ class ImageBitmapLoader extends Loader {
 	 * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
 	 * @param {onProgressCallback} onProgress - Unsupported in this loader.
 	 * @param {onErrorCallback} onError - Executed when errors occur.
-	 * @return {ImageBitmap|undefined} The image bitmap.
 	 */
 	load( url, onLoad, onProgress, onError ) {
 
@@ -145,8 +144,6 @@ class ImageBitmapLoader extends Loader {
 
 						scope.manager.itemEnd( url );
 
-						return imageBitmap;
-
 					}
 
 				} );
@@ -164,7 +161,7 @@ class ImageBitmapLoader extends Loader {
 
 			}, 0 );
 
-			return cached;
+			return;
 
 		}
 
@@ -189,8 +186,6 @@ class ImageBitmapLoader extends Loader {
 
 			scope.manager.itemEnd( url );
 
-			return imageBitmap;
-
 		} ).catch( function ( e ) {
 
 			if ( onError ) onError( e );

粤ICP备19079148号