Skip to content

Commit 86bd3d5

Browse files
authored
Loaders: Make return types in load() consistent. (#33380)
1 parent 32b4d93 commit 86bd3d5

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/loaders/FileLoader.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class FileLoader extends Loader {
7474
* @param {function(any)} onLoad - Executed when the loading process has been finished.
7575
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
7676
* @param {onErrorCallback} [onError] - Executed when errors occur.
77-
* @return {any|undefined} The cached resource if available.
7877
*/
7978
load( url, onLoad, onProgress, onError ) {
8079

@@ -98,7 +97,7 @@ class FileLoader extends Loader {
9897

9998
}, 0 );
10099

101-
return cached;
100+
return;
102101

103102
}
104103

src/loaders/ImageBitmapLoader.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class ImageBitmapLoader extends Loader {
107107
* @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
108108
* @param {onProgressCallback} onProgress - Unsupported in this loader.
109109
* @param {onErrorCallback} onError - Executed when errors occur.
110-
* @return {ImageBitmap|undefined} The image bitmap.
111110
*/
112111
load( url, onLoad, onProgress, onError ) {
113112

@@ -145,8 +144,6 @@ class ImageBitmapLoader extends Loader {
145144

146145
scope.manager.itemEnd( url );
147146

148-
return imageBitmap;
149-
150147
}
151148

152149
} );
@@ -164,7 +161,7 @@ class ImageBitmapLoader extends Loader {
164161

165162
}, 0 );
166163

167-
return cached;
164+
return;
168165

169166
}
170167

@@ -189,8 +186,6 @@ class ImageBitmapLoader extends Loader {
189186

190187
scope.manager.itemEnd( url );
191188

192-
return imageBitmap;
193-
194189
} ).catch( function ( e ) {
195190

196191
if ( onError ) onError( e );

0 commit comments

Comments
 (0)