David Catuhe пре 7 година
родитељ
комит
9cdfae9f9e

Разлика између датотеке није приказан због своје велике величине
+ 8925 - 8925
Playground/babylon.d.txt


Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
Viewer/dist/viewer.js


Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
Viewer/dist/viewer.min.js


Разлика између датотеке није приказан због своје велике величине
+ 12545 - 12545
dist/preview release/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.js


+ 3 - 0
dist/preview release/babylon.max.js

@@ -8675,6 +8675,9 @@ var BABYLON;
                         var returnedPromise = returnedValue;
                         returnedPromise._moveChildren(this._children);
                     }
+                    else {
+                        value = returnedValue;
+                    }
                 }
                 for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
                     var child = _a[_i];

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.worker.js


Разлика између датотеке није приказан због своје велике величине
+ 6373 - 6373
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 3 - 0
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -8675,6 +8675,9 @@ var BABYLON;
                         var returnedPromise = returnedValue;
                         returnedPromise._moveChildren(this._children);
                     }
+                    else {
+                        value = returnedValue;
+                    }
                 }
                 for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
                     var child = _a[_i];

+ 3 - 0
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -8661,6 +8661,9 @@ var BABYLON;
                         var returnedPromise = returnedValue;
                         returnedPromise._moveChildren(this._children);
                     }
+                    else {
+                        value = returnedValue;
+                    }
                 }
                 for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
                     var child = _a[_i];

+ 3 - 0
dist/preview release/es6.js

@@ -8661,6 +8661,9 @@ var BABYLON;
                         var returnedPromise = returnedValue;
                         returnedPromise._moveChildren(this._children);
                     }
+                    else {
+                        value = returnedValue;
+                    }
                 }
                 for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
                     var child = _a[_i];

Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


+ 1 - 1
dist/preview release/what's new.md

@@ -7,7 +7,7 @@
 - `WebVRCamera` now supports GearVR ([brianzinn](https://github.com/brianzinn))
 - New glTF [serializer](https://github.com/BabylonJS/Babylon.js/tree/master/serializers/src/glTF/2.0). You can now export glTF or glb files directly from a Babylon scene ([kcoley](https://github.com/kcoley))
 - Babylon.js now uses Promises in addition to callbacks. We created several `xxxAsync` functions all over the framework (`SceneLoader.AppendAsync` for instance, which returns a Promise). A polyfill is also integrated to support older browsers ([deltakosh](https://github.com/deltakosh))
-- Introduced Projection Texture on SpotLight (`spotLight.projectedLightTexture`). ([lostink](https://github.com/lostink))
+- Introduced Projection Texture on SpotLight (`spotLight.projectedLightTexture`) ([lostink](https://github.com/lostink))
 
 ## Updates
 - Tons of functions and classes received the code comments they deserved (All the community)

+ 2 - 0
src/Tools/babylon.promise.ts

@@ -135,6 +135,8 @@ module BABYLON {
                         let returnedPromise = returnedValue as InternalPromise<T>;
                         
                         returnedPromise._moveChildren(this._children);
+                    } else {
+                        value = <T>returnedValue;
                     }
                 }
 

+ 24 - 0
tests/unit/babylon/promises/babylon.promises.tests.ts

@@ -175,4 +175,28 @@ describe('Babylon.Promise', () => {
             });
         });
     });     
+
+    describe('#All and then', () => {
+        it('should correctly handle chaining a returning then after a all', (done) => {
+            mocha.timeout(10000);
+            var delayAsync = function (timeout) {
+                return new Promise(function (resolve) {
+                    setTimeout(function () {
+                        resolve(1);
+                    }, timeout);
+                });
+            };
+            
+            var promise = Promise.all([delayAsync(100), delayAsync(200)]).then(function () {
+                return 2;
+            });
+            
+            promise.then(function (value) {
+                value.should.be.equal(2);
+                done();
+            }); 
+        });
+    });      
+
+
 });