@@ -247,7 +247,7 @@ GLTFShader.prototype.update = function( scene, camera ) {
247
247
248
248
}
249
249
250
- } . bind ( this ) ) ;
250
+ } . bind ( this ) ) ;
251
251
252
252
} ;
253
253
@@ -569,33 +569,38 @@ var _each = function( object, callback, thisObj ) {
569
569
results = [ ] ;
570
570
571
571
var length = object . length ;
572
- for ( let idx = 0 ; idx < length ; idx ++ ) {
573
- let value = callback . call ( thisObj || this , object [ idx ] , idx ) ;
574
- fns . push ( value ) ;
575
- if ( value && value instanceof Promise ) {
576
- value . then ( function ( value ) {
572
+ for ( var idx = 0 ; idx < length ; idx ++ ) {
573
+ var value = callback . call ( thisObj || this , object [ idx ] , idx ) ;
574
+ if ( value ) {
575
+ fns . push ( value ) ;
576
+ if ( value instanceof Promise ) {
577
+ value . then ( function ( key , value ) {
578
+ results [ idx ] = value ;
579
+ } . bind ( this , key ) ) ;
580
+ } else {
577
581
results [ idx ] = value ;
578
- } ) ;
579
- } else {
580
- results [ idx ] = value ;
582
+ }
581
583
}
582
584
583
585
}
584
586
585
587
} else {
586
588
589
+
587
590
results = { } ;
588
591
589
- for ( let key in object ) {
592
+ for ( var key in object ) {
590
593
if ( object . hasOwnProperty ( key ) ) {
591
- let value = callback . call ( thisObj || this , object [ key ] , key ) ;
592
- fns . push ( value ) ;
593
- if ( value && value instanceof Promise ) {
594
- value . then ( function ( value ) {
594
+ var value = callback . call ( thisObj || this , object [ key ] , key ) ;
595
+ if ( value ) {
596
+ fns . push ( value ) ;
597
+ if ( value instanceof Promise ) {
598
+ value . then ( function ( key , value ) {
599
+ results [ key ] = value ;
600
+ } . bind ( this , key ) ) ;
601
+ } else {
595
602
results [ key ] = value ;
596
- } ) ;
597
- } else {
598
- results [ key ] = value ;
603
+ }
599
604
}
600
605
}
601
606
}
0 commit comments