View Full Version : Extending the Object

22 Oct 2007, 1:06 AM
I am trying to add a simple function into my application so I could easily trace the available methods that i could get in an object instance.

Object.prototype.methods = function() {
var meth = new Array();
for (var i in this) {
if (typeof this[i] === 'function') {
return meth;

but Ext gives the following error:

D.addListener is not a function
Line 12

But when I included the code at the very end of the Ext.onReady function it works fine.

Am I breaking something that Ext would not allow me to do?

22 Oct 2007, 5:40 AM
hmm good question I'd probably say yea it breaks something.

and here's an easier thing to do if you want to list all functions/properties from an object by the way. You need firebug to use it ;)