Fix the initial scene readiness check to actually work. v1.1
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 8 Sep 2014 14:21:16 +0000 (16:21 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 8 Sep 2014 14:21:16 +0000 (16:21 +0200)
src/yuu/core.js
src/yuu/director.js

index 8b16707c8d1a1c369a5aa19f1161d4d68bc86dc3..25d3ed2a52710ffb2da77e3445aaefae85420908 100644 (file)
             initOptions = options || {};
             yuu.log("messages", "Initializing Yuu engine.");
             var promises = [];
-            yf.each(function (hook) {
-                promises.push(hook.call(yuu, initOptions));
-            }, initHooks);
+            // initHooks can be pushed to while iterating, so iterate
+            // by index, not a foreach loop.
+            for (var i = 0; i < initHooks.length; ++i)
+                promises.push(initHooks[i].call(yuu, initOptions));
             initHooks = null; // Bust future registerInitHook calls.
             yuu.log("messages", "Initialization hooks complete.");
             if (gui) {
index 872301430eeb8f4d0b0a762acbb328db0959c462..385a3e7970a8287a5c2b5fc28ba1e56dd5cf2be7 100644 (file)
             /** The standard director */
 
         yuu.registerInitHook(function () {
-            return yuu.ready(director.scenes);
+            return yuu.ready(director._scenes);
         });
     });