You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/07/05 15:36:05 UTC

svn commit: r419257 - /incubator/xap/trunk/src/xap/util/Utils.js

Author: mturyn
Date: Wed Jul  5 08:36:04 2006
New Revision: 419257

URL: http://svn.apache.org/viewvc?rev=419257&view=rev
Log:
Added a method to help in debugging---a first-level object dump.

Modified:
    incubator/xap/trunk/src/xap/util/Utils.js

Modified: incubator/xap/trunk/src/xap/util/Utils.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/util/Utils.js?rev=419257&r1=419256&r2=419257&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/util/Utils.js (original)
+++ incubator/xap/trunk/src/xap/util/Utils.js Wed Jul  5 08:36:04 2006
@@ -38,3 +38,18 @@
 
 Utils.s_pathCache = null;
 
+/**
+ * Method for debugging---less than a full object-dump, more than toString()
+**/
+Utils.interrogate = function(obj){
+	var s="" ;
+	if (typeof obj != "object"){
+		s = "<not an object>" ;
+	} else {
+		for (var keyy in obj){ s += "^"+keyy+':'+obj[keyy] ; }
+	}
+	// Puts the result, with CR/LFs turned to carets, into
+	// the copyable part of a prompt box:
+	prompt("",s.replace(/[\r\n]/g,"^")) ;  
+}
+