You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jb...@apache.org on 2010/08/16 07:42:19 UTC
svn commit: r985794 -
/commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js
Author: jbeard
Date: Mon Aug 16 05:42:19 2010
New Revision: 985794
URL: http://svn.apache.org/viewvc?rev=985794&view=rev
Log:
Removed dead code relating to E4X.
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js?rev=985794&r1=985793&r2=985794&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/util.js Mon Aug 16 05:42:19 2010
@@ -21,60 +21,6 @@ This module contains basic utilities.
require.def("src/javascript/scxml/cgf/util",
{
-
- //source: https://developer.mozilla.org/En/E4X_for_templating
- /*
- The first two arguments are optional: (h is a handler with an explicit argument v only, or beginning with k, v)
- lev is optional argument to note recursive depth (if part of recursion)
- */
- foreach : function(min, max, arr, h, lev) {
- var k, ret=<></>, it = 1;
- lev = lev || 0;
- if (typeof min === 'number') {
- if (typeof max !== 'number') {
- lev = h;
- h = arr;
- arr = max;
- max = min;
- min = 1;
- }
- }
- else {
- lev = arr;
- h = max;
- arr = min;
- max = Number.POSITIVE_INFINITY;
- min = 1;
- }
- if (h.length === 1) {
- for (k in arr) {
- if (it < min) {
- ++it;
- continue;
- }
- if (it > max) {
- break;
- }
- ret+=h(arr[k], it, lev); // Need to get it or lev via arguments[] since our length detection implies no explicit additional params; otherwise define with more than one param (see below)
- ++it;
- }
- }
- else {
- for (k in arr) {
- if (it < min) {
- ++it;
- continue;
- }
- if (it > max) {
- break;
- }
- ret+=h(k, arr[k], it, lev);
- ++it;
- }
- }
- return ret;
- },
-
toJsArray : function (args){
var toReturn = [];