Author: ptw
Date: 2007-08-14 10:00:28 -0700 (Tue, 14 Aug 2007)
New Revision: 6048

Modified:
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataAttrBind.lzs
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LzText.lzs
Log:
Change 20070814-ptw-o by [EMAIL PROTECTED] on 2007-08-14 11:49:58 EDT
    in /Users/ptw/OpenLaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Improve debug printing of LzDataAttrBind objects

Technical Reviewer: hminsky (pending)
QA Reviewer: max (pending)

Details:
    Improved the printing of LzDataAttrBind objects a little to help
    me diagnose LPP-4494.

    LzDebug: Don't escape quotes in strings if you are not quoting the
    string.

    LzText: Don't override lz.node#_dbg_name unless it would resort to
    calling lz.text.toString.

    LzDataAttrBind: Don't quote the $path expression

    LzClass: Distinguish between class instance methods and methods
    that have been added directly to an instance.

Tests:
    IWFM



Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs   
2007-08-14 16:59:44 UTC (rev 6047)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs   
2007-08-14 17:00:28 UTC (rev 6048)
@@ -68,8 +68,20 @@
       }
       if ($debug) {
         if (! value._dbg_typename) {
+          // Delay 'til runtime so classes can adjust their name to be
+          // their tag name
           value._dbg_owner = this;
-          value._dbg_typename = function () {return 
this._dbg_owner._dbg_typename + ' function'};
+          value._dbg_typename = function () {
+            var o = this._dbg_owner;
+            var t = o._dbg_typename;
+            // Prototypes have their own typename, instances should
+            // not, use that to distinguish methods that have been
+            // added directly to instances
+            if (! o.hasOwnProperty('_dbg_typename')) {
+              t += '#' + Debug.IDForObject(o);
+            }
+            return t + ' function';
+          }
         }
       }
     }

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataAttrBind.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataAttrBind.lzs      
2007-08-14 16:59:44 UTC (rev 6047)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataAttrBind.lzs      
2007-08-14 17:00:28 UTC (rev 6048)
@@ -94,7 +94,7 @@
 
 if ($debug) {
     function _dbg_name () {
-        return Debug.formatToString("%w.%s=\"$path{'%w'}\"", this.node, 
this.setAttr, this.xpath);
+        return Debug.formatToString("%w.%s=\"$path{%w}\"", this.node, 
this.setAttr, this.xpath);
     }
 }
 

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs 
2007-08-14 16:59:44 UTC (rev 6047)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs 
2007-08-14 17:00:28 UTC (rev 6048)
@@ -274,9 +274,12 @@
   // Have to handle '\\' first.
   s = s.split('\\').join('\\\\');
   var np = this.singleEscapeCharacters;
-  var skip = "";
+  // quotes are skipped and ignored unless quoted
+  var skip = '"';
   var quote = "";
+  var ignore = "'";
   if (quoted) {
+    ignore = "";
     var singles = s.split("'").length;
     var doubles = s.split('"').length;
     if (singles > doubles) {
@@ -289,7 +292,7 @@
   }
   for (var rep in np) {
     var ch = np[rep];
-    if ((ch != '\\') && (ch != skip)) {
+    if ((ch != '\\') && (ch != skip)  && (ch != ignore)) {
       s = s.split(ch).join(rep);
     }
   }

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LzText.lzs     
2007-08-14 16:59:44 UTC (rev 6047)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LzText.lzs     
2007-08-14 17:00:28 UTC (rev 6048)
@@ -478,6 +478,19 @@
 }
 
 
+if ($debug) {
+/**
+  * @access private
+  */
+function _dbg_name ( ){
+  var id = super._dbg_name();
+  if (id != this.toString()) {
+    return id;
+  } else {
+    return Debug.stringEscape(this.getText(), true);
+  }
+}
+}
 
 /**
   * @access private


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to