There are lots of things going to break if you mess with the Object prototype. Is there any reason that you are? It is generally considered bad practice.

I have to go thru the scripts and find all for...in loops and clear this up for the next release.

Animal

10 Oct 2006, 7:39 AM

I've added an isInstanceOf() method which goes up the superclass chain created by YAHOO.extend()

That way, I can check if any container passed to my AspicioList constructor to hold the list is an instance of YAHOO.widget.Panel. It will probably be a subclass, but if it's a Panel, I know to create the container Element from its body property. If it's not, then it might be an Element, an HTMLElement, or a String id, so I can create the container Element directly.

I suppose it should just be a static method "isInstanceOf(obj, class)" rather than a method of Object, but it seems like it should be there!

jack.slocum

10 Oct 2006, 7:44 AM

I agree instanceOf should be there. I once created one myself and got rid of it quickly. Instead I use: