diff options
| author | Igor Minar | 2011-01-07 22:02:23 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-10 10:26:55 -0800 |
| commit | 0a6cf70debc6440685af3f9ea96a66450e4f4ed7 (patch) | |
| tree | 3b7e82bedf53960deb5d460532779ec449dd8dfc /src/scenario/Describe.js | |
| parent | c79aba92f6b058742c9ae20a9382f6abc68afcea (diff) | |
| download | angular.js-0a6cf70debc6440685af3f9ea96a66450e4f4ed7.tar.bz2 | |
Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.
- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
clober it self when we extend the angular object with an
object that has a forEach property equal to this forEach function
Closes #85
Diffstat (limited to 'src/scenario/Describe.js')
| -rw-r--r-- | src/scenario/Describe.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scenario/Describe.js b/src/scenario/Describe.js index 69ed8238..50cfded6 100644 --- a/src/scenario/Describe.js +++ b/src/scenario/Describe.js @@ -21,7 +21,7 @@ angular.scenario.Describe = function(descName, parent) { var beforeEachFns = this.beforeEachFns; this.setupBefore = function() { if (parent) parent.setupBefore.call(this); - angular.foreach(beforeEachFns, function(fn) { fn.call(this); }, this); + angular.forEach(beforeEachFns, function(fn) { fn.call(this); }, this); }; /** @@ -29,7 +29,7 @@ angular.scenario.Describe = function(descName, parent) { */ var afterEachFns = this.afterEachFns; this.setupAfter = function() { - angular.foreach(afterEachFns, function(fn) { fn.call(this); }, this); + angular.forEach(afterEachFns, function(fn) { fn.call(this); }, this); if (parent) parent.setupAfter.call(this); }; }; @@ -133,14 +133,14 @@ angular.scenario.Describe.prototype.xit = angular.noop; */ angular.scenario.Describe.prototype.getSpecs = function() { var specs = arguments[0] || []; - angular.foreach(this.children, function(child) { + angular.forEach(this.children, function(child) { child.getSpecs(specs); }); - angular.foreach(this.its, function(it) { + angular.forEach(this.its, function(it) { specs.push(it); }); var only = []; - angular.foreach(specs, function(it) { + angular.forEach(specs, function(it) { if (it.only) { only.push(it); } |
