I propose migrating this change to 4.0.1.

Risk: very low -- affects format of Debug printing of anonymous objects
Reward: people will be less likely to be fooled that the representation of an anonymous object is complete when it has been abbreviated.

On 2007-04-01, at 07:36 EDT, [EMAIL PROTECTED] wrote:

Author: ptw
Date: 2007-04-01 04:36:19 -0700 (Sun, 01 Apr 2007)
New Revision: 4559

Modified:
openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/ dhtml/LzDebug.js openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/swf/ LzDebug.as
Log:
Change 20070326-ptw-b by [EMAIL PROTECTED] on 2007-03-26 15:26:58 EDT
    in /Users/ptw/OpenLaszlo/legals-1
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Debugger indicates when it is abbreviating an object

Bugs Fixed:
LPP-3784 'Debugger needs to indicate when it has abbreviated an object.'

Technical Reviewer: hminsky (Message-ID: <[EMAIL PROTECTED]>)
QA Reviewer: antun (pending)
Doc Reviewer: jsundman (pending)

Documentation:
When the debugger prints an object, it tries to print a concise
description of the object -- if the object has a name or id, it will
try to use that name.  For anonymous objects, it will print some of
the properties of the object (if not all the properties are printed,
it will print `...` to indicate the elision).  If you want details of
the object, you should inspect the object, but note that even
inspection does not show methods or inherited properties.

Tests:
    IWFM



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/ platform/dhtml/LzDebug.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/ dhtml/LzDebug.js 2007-04-01 11:20:52 UTC (rev 4558) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/ dhtml/LzDebug.js 2007-04-01 11:36:19 UTC (rev 4559)
@@ -327,21 +327,28 @@
if ((! thing instanceof Object) || (thing.constructor !== Object)) {
           pretty = (! unique);
         }
+        var ellip = true;
         for (var e in thing) {
+          var v = thing[e];
+          var tv = typeof(v);
+          var dtv = this.__typeof(v);
           // Don't enumerate inherited props, unless you can't tell
-          if ((! thing.hasOwnProperty) || thing.hasOwnProperty(e)) {
-            var v = thing[e];
-            var tv = typeof(v);
-            var dtv = this.__typeof(v);
-            // Ignore "empty" properties and methods, ignore internal
-            // slots and slots that have an internal type
-            if ((tv != 'undefined') &&
-                (tv != 'function') &&
-                (('' + v) != '') &&
-                (! this.internalProperty(e)) &&
-                (! this.internalProperty(dtv))) {
- // TODO: [2005-06-22 ptw] Use __String in case element is huge
-              s += '' + e + ': ' + String(v) + ', ';
+          // (i.e., __proto__ chain is broken
+          // Ignore "empty" properties and methods, ignore internal
+          // slots and slots that have an internal type
+ if (((! (thing instanceof Object)) || thing.hasOwnProperty(e)) &&
+              (tv != 'undefined') &&
+              (tv != 'function') &&
+              (('' + v) != '') &&
+              (! this.internalProperty(e)) &&
+              (! this.internalProperty(dtv))) {
+            ellip = true;
+ // TODO: [2005-06-22 ptw] Use __String in case element is huge
+            s += '' + e + ': ' + String(v) + ', ';
+          } else {
+            if (ellip) {
+              s += '..., ';
+              ellip = false;
             }
           }
           // Don't accumulate beyond limit

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/ platform/swf/LzDebug.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/ swf/LzDebug.as 2007-04-01 11:20:52 UTC (rev 4558) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/platform/ swf/LzDebug.as 2007-04-01 11:36:19 UTC (rev 4559)
@@ -388,22 +388,28 @@
       if (op !== Object.prototype) {
         pretty = (! unique);
       }
+      var ellip = true;
       for (var e in thing) {
+        var v = thing[e];
+        var tv = typeof(v);
+        var dtv = this.__typeof(v);
         // Don't enumerate inherited props, unless you can't tell
         // (i.e., __proto__ chain is broken
- if ((! (thing instanceof Object)) || thing.hasOwnProperty (e)) {
-          var v = thing[e];
-          var tv = typeof(v);
-          var dtv = this.__typeof(v);
-          // Ignore "empty" properties and methods, ignore internal
-          // slots and slots that have an internal type
-          if ((tv != 'undefined') &&
-              (tv != 'function') &&
-              (('' + v) != '') &&
-              (! this.internalProperty(e)) &&
-              (! this.internalProperty(dtv))) {
- // TODO: [2005-06-22 ptw] Use __String in case element is huge
-            s += '' + e + ': ' + String(v) + ', ';
+        // Ignore "empty" properties and methods, ignore internal
+        // slots and slots that have an internal type
+ if (((! (thing instanceof Object)) || thing.hasOwnProperty (e)) &&
+            (tv != 'undefined') &&
+            (tv != 'function') &&
+            (('' + v) != '') &&
+            (! this.internalProperty(e)) &&
+            (! this.internalProperty(dtv))) {
+          ellip = true;
+ // TODO: [2005-06-22 ptw] Use __String in case element is huge
+          s += '' + e + ': ' + String(v) + ', ';
+        } else {
+          if (ellip) {
+            s += '..., ';
+            ellip = false;
           }
         }
         // Don't accumulate beyond limit


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

Reply via email to