From f274a6a50b184cc031636e7ef8da89d0da696cc5 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 8 Sep 2014 16:21:16 +0200 Subject: [PATCH] Fix the initial scene readiness check to actually work. --- src/yuu/core.js | 7 ++++--- src/yuu/director.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/yuu/core.js b/src/yuu/core.js index 8b16707..25d3ed2 100644 --- a/src/yuu/core.js +++ b/src/yuu/core.js @@ -96,9 +96,10 @@ 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) { diff --git a/src/yuu/director.js b/src/yuu/director.js index 8723014..385a3e7 100644 --- a/src/yuu/director.js +++ b/src/yuu/director.js @@ -687,7 +687,7 @@ /** The standard director */ yuu.registerInitHook(function () { - return yuu.ready(director.scenes); + return yuu.ready(director._scenes); }); }); -- 2.30.2