From 0a6cf70debc6440685af3f9ea96a66450e4f4ed7 Mon Sep 17 00:00:00 2001
From: Igor Minar
Date: Fri, 7 Jan 2011 22:02:23 -0800
Subject: 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
---
src/scenario/output/Html.js | 2 +-
src/scenario/output/Xml.js | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'src/scenario/output')
diff --git a/src/scenario/output/Html.js b/src/scenario/output/Html.js
index 4a682b9a..6e2e20f3 100644
--- a/src/scenario/output/Html.js
+++ b/src/scenario/output/Html.js
@@ -121,7 +121,7 @@ angular.scenario.output('html', function(context, runner) {
*/
function findContext(spec) {
var currentContext = context.find('#specs');
- angular.foreach(model.getDefinitionPath(spec), function(defn) {
+ angular.forEach(model.getDefinitionPath(spec), function(defn) {
var id = 'describe-' + defn.id;
if (!context.find('#' + id).length) {
currentContext.find('> .test-children').append(
diff --git a/src/scenario/output/Xml.js b/src/scenario/output/Xml.js
index cbc55ee7..e8c7f0e3 100644
--- a/src/scenario/output/Xml.js
+++ b/src/scenario/output/Xml.js
@@ -17,7 +17,7 @@ angular.scenario.output('xml', function(context, runner) {
* @param {Object} tree node to serialize
*/
function serializeXml(context, tree) {
- angular.foreach(tree.children, function(child) {
+ angular.forEach(tree.children, function(child) {
var describeContext = $('');
describeContext.attr('id', child.id);
describeContext.attr('name', child.name);
@@ -26,14 +26,14 @@ angular.scenario.output('xml', function(context, runner) {
});
var its = $('');
context.append(its);
- angular.foreach(tree.specs, function(spec) {
+ angular.forEach(tree.specs, function(spec) {
var it = $('');
it.attr('id', spec.id);
it.attr('name', spec.name);
it.attr('duration', spec.duration);
it.attr('status', spec.status);
its.append(it);
- angular.foreach(spec.steps, function(step) {
+ angular.forEach(spec.steps, function(step) {
var stepContext = $('');
stepContext.attr('name', step.name);
stepContext.attr('duration', step.duration);
--
cgit v1.2.3