Author: jmorliaguet
Date: Sat Feb 11 15:38:13 2006
New Revision: 2351

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
Log:

- improved robustness



Modified: cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     Sat Feb 11 
15:38:13 2006
@@ -83,7 +83,8 @@
 ctal.tal_attributes = function(tmpl, value, data) {
   var attrs = value.split(";");
   for (var i=0; i<attrs.length; i++) {
-    var attr = attrs[i];
+    var attr = ctal.trim(attrs[i]);
+    if (!attr) continue;
     var nmx = ctal.get_nameexpr(attr);
     var aname = nmx[0]
     var avalue = ctal.eval_expr(data, nmx[1])
@@ -210,15 +211,12 @@
 
 ctal.eval_pathexpr = function(data, path) {
   var pathelems = path.split("/");
-  // XXX use a shallow copy
   var traverse = data;
   for (var i=0; i < pathelems.length; i++) {
-    if (typeof traverse[pathelems[i]] == "undefined") {
+    traverse = traverse[pathelems[i]];
+    if (typeof traverse == "undefined") {
       throw new ctal.TALESError('No data found for "' + path + '"')
     }
-    else {
-      traverse = traverse[pathelems[i]];
-    }
   }
   return traverse;
 }
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to