From c53b36a9b2f2f55f272ff1c5295042e5bd76f501 Mon Sep 17 00:00:00 2001 From: "Dan Hansen and Davis W. Frank" Date: Tue, 19 Feb 2013 15:26:08 -0800 Subject: [PATCH] Fix Build: Firefox doesn't hoist function definitions in for loops --- lib/jasmine-core/jasmine.js | 12 ++++++------ src/core/Suite.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index d5f4f8d2..62c50503 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1734,12 +1734,6 @@ jasmine.Suite.prototype.execute = function(onComplete) { for (var i = 0; i < children.length; i++) { allFns.push(wrapChild(children[i])); - - function wrapChild(child) { - return function(done) { - child.execute(done); - } - } } this.onStart(this); @@ -1756,6 +1750,12 @@ jasmine.Suite.prototype.execute = function(onComplete) { onComplete(); } } + + function wrapChild(child) { + return function (done) { + child.execute(done); + } + } }; jasmine.Clock = function(global, delayedFunctionScheduler) { var self = this, diff --git a/src/core/Suite.js b/src/core/Suite.js index 5fbdaabf..acb12e14 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -74,12 +74,6 @@ jasmine.Suite.prototype.execute = function(onComplete) { for (var i = 0; i < children.length; i++) { allFns.push(wrapChild(children[i])); - - function wrapChild(child) { - return function(done) { - child.execute(done); - } - } } this.onStart(this); @@ -96,4 +90,10 @@ jasmine.Suite.prototype.execute = function(onComplete) { onComplete(); } } + + function wrapChild(child) { + return function (done) { + child.execute(done); + } + } };