Author: ptw
Date: 2007-10-10 05:29:01 -0700 (Wed, 10 Oct 2007)
New Revision: 6779

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
Log:
Change 20071009-ptw-M by [EMAIL PROTECTED] on 2007-10-09 18:28:50 EDT
    in /Users/ptw/OpenLaszlo/ringding-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Re-enable Monitor messages

Bugs Fixed:
LPP-4855 'Debug.monitor does not appear to be working'

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

Details:
    LzDebug: Add MONITOR and TRACE as valid message levels

    kernel.*: If message type does not have a valid level, always
    print it.

    LzMonitor, LzTrace: Give constructors a name.

Tests:
    lzx> Debug.monitor(canvas, 'version')
    lzx> canvas.version=888
    MONITOR @simple.lzx#1: [845525.00] Debug.doEval: #canvas.version: '4.1.x.0' 
-> 888
    888



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs       2007-10-10 
12:26:06 UTC (rev 6778)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs       2007-10-10 
12:29:01 UTC (rev 6779)
@@ -49,7 +49,7 @@
 /**
  * Possible values of Debug.messageLevel (q.v.)
  */
-Debug.messageLevels = {ALL: 0, DEBUG: 1, INFO: 2, WARNING: 3, ERROR: 4, NONE: 
5};
+Debug.messageLevels = {ALL: 0, MONITOR: 1, TRACE: 2, DEBUG: 3, INFO: 4, 
WARNING: 5, ERROR: 6, NONE: 7};
 
 /**
  * Debug messages are enabled/disabled by the
@@ -461,6 +461,45 @@
     }
   }
   Debug.format("\n---END OF BUG REPORT---\n");
-}
+};
 
+/**
+ * Fills two arrays with the object's own properties.  If the object has a
+ * 'length' property (i.e., might be intended as an Array), numeric
+ * names that fall between 0 and the value of length are added to the
+ * `indices` array, otherwise they are added to the `names` array.  If
+ * either array is null, those properties will be omitted altogether.
+ * @param obj:Object the object to examine
+ * @param names:Array the array to append names to
+ * @param indices:Array the array to append indices to
+ * @param limit:Number don't accumulate more than this many properties
+ * (used to limit computation on large objects), default Infinity
+ */
+Debug.objectOwnProperties = function (obj, names, indices, limit) {
+  if (!limit) { limit = Infinity; };
+  var alen = (('length' in obj) && (! isNaN(obj.length)) && (obj.length >= 0)) 
? obj.length : false;
+  var hopp = 'hasOwnProperty' in obj;
+  var proto = (('__proto__' in obj) ? obj.__proto__ :
+               (('constructor' in obj) ? obj.constructor.prototype : false));
+  for (var key in obj) {
+    if ((! hopp) ||
+        obj.hasOwnProperty(key) ||
+        // Heuristic to find getter slots (there is no way to ask if a
+        // property is a getter)
+        (proto && (obj[key] !== proto[key]))) {
+      if ((alen != false) && (! isNaN(key)) && (0 <= key) && (key < alen)) {
+        if (indices) {
+          // Ensure indices are numbers, not strings
+          indices.push(Number(key));
+          if (--limit == 0) { return; }
+        }
+      } else {
+        if (names) {
+          names.push(key);
+          if (--limit == 0) { return; }
+        }
+      }
+    }
+  }
+};
 

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMonitor.lzs     2007-10-10 
12:26:06 UTC (rev 6778)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMonitor.lzs     2007-10-10 
12:29:01 UTC (rev 6779)
@@ -16,7 +16,7 @@
   *
   * @access private
   */
-var LzMonitor = function(file, line, message) {
+function LzMonitor (file, line, message) {
   // super.apply(arguments);
   LzSourceMessage.apply(this, arguments);
 };

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs       2007-10-10 
12:26:06 UTC (rev 6778)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs       2007-10-10 
12:29:01 UTC (rev 6779)
@@ -16,7 +16,7 @@
   * A Trace is a warning with the tag 'TRACE'
   * @access private
   */
-var LzTrace = function(file, line, message) {
+function LzTrace (file, line, message) {
   // super.apply(arguments);
   LzSourceMessage.apply(this, arguments);
 }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js  
2007-10-10 12:26:06 UTC (rev 6778)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js  
2007-10-10 12:29:01 UTC (rev 6779)
@@ -231,7 +231,9 @@
     var msg = xtor.format.apply(xtor, [null, 
null].concat(Array.prototype.slice.call(arguments, 1)));
     {
       var mls = this.messageLevels;
-      if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+      var t = xtor.prototype.type;
+      // Default to printing any 'unknown' types
+      if ((t in mls) ? (mls[t] >= mls[this.messageLevel]) : true) {
         this.freshLine();
         this.__write(msg);
       }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as    
2007-10-10 12:26:06 UTC (rev 6778)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as    
2007-10-10 12:29:01 UTC (rev 6779)
@@ -118,7 +118,9 @@
     var msg = xtor.format.apply(xtor, [null, 
null].concat(Array.prototype.slice.call(arguments, 1)));
   {
     var mls = this.messageLevels;
-    if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+    var t = xtor.prototype.type;
+    // Default to printing any 'unknown' types
+    if ((t in mls) ? (mls[t] >= mls[this.messageLevel]) : true) {
       this.freshLine();
       this.__write(msg);
     }


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

Reply via email to