Author: jmorliaguet
Date: Sun Jun 11 16:22:16 2006
New Revision: 3397

Modified:
   cpsskins/branches/paris-sprint-2006/lib/ctal/src/ctal.js

Log:

- optimization



Modified: cpsskins/branches/paris-sprint-2006/lib/ctal/src/ctal.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/lib/ctal/src/ctal.js    (original)
+++ cpsskins/branches/paris-sprint-2006/lib/ctal/src/ctal.js    Sun Jun 11 
16:22:16 2006
@@ -160,16 +160,17 @@
   var marker = tmpl.nextSibling;
 
   // the iterator variable has the same name as the looped through array.
-  if (nmx[0] == nmx[1]) {
+  var iterator = nmx[0];
+  if (iterator == nmx[1]) {
     throw new ctal.TALError(nmx[0] +
-      " iterator variable overwrites loop variable.");
+      " iterator variable shadows loop variable.");
   }
 
   // do a deep copy of the data structure traversed by the repeat loop
   // to avoid corrupting it.
   var saved_data = ctal.deepcopy(data);
   for (var i=0; i<datas.length; i++) {
-    data[nmx[0]] = datas[i];
+    data[iterator] = datas[i];
 
     var newnode = tmpl.cloneNode(true);
     ctal.node_insertbefore(parent, newnode, marker);
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to