Author: ptw
Date: 2008-01-15 06:40:47 -0800 (Tue, 15 Jan 2008)
New Revision: 7833

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs
Log:
Change 20080115-ptw-k by [EMAIL PROTECTED] on 2008-01-15 09:35:11 EST
    in /Users/ptw/OpenLaszlo/ringding-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Make Debug.trace work with 'traditional' Javascript objects

Bugs Fixed:
LPP-5359 'Debug.trace does not work for 'traditional' Javascript objects'

Technical Reviewer: [EMAIL PROTECTED] (pending)

Details:
    Only use addProperty if the object is an instance of Instance,
    otherwise do it manually.

Tests:
    IWFM



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs       2008-01-15 
06:00:07 UTC (rev 7832)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzTrace.lzs       2008-01-15 
14:40:47 UTC (rev 7833)
@@ -3,7 +3,7 @@
 /**
   * Support for tracing function calls in the debugger
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @access public
@@ -79,10 +79,17 @@
       return r;
     };
     m._dbg_previous_definition = f;
-    who.addProperty(what, m);
+    // Use addProperty for our classes, otherwise just jam it in
+    if (who is Instance) {
+      who.addProperty(what, m);
+    } else {
+      who[what] = m;
+    }
+    return who[what] === m;
   } else {
     Debug.error('%w.%s is not a function', who, what);
   }
+  return false;
 }
 
 /**
@@ -105,12 +112,19 @@
       }
       // If that didn't work, apply previous
       if (who[what] !== p) {
-        who.addProperty(what, p);
+        // Use addProperty for our classes, otherwise just jam it in
+        if (who is Instance) {
+          who.addProperty(what, p);
+        } else {
+          who[what] = p;
+        }
       }
+      return who[what] === p;
     } else {
         Debug.error('%w.%s is not being traced', who, what);
     }
   } else {
     Debug.error('%w.%s is not a function', who, what);
   }
+  return false;
 }


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

Reply via email to