IMO you can't. What you can do is
assertTrue(MyClass instanceof MyGenerricClass);

On Mon, Dec 6, 2010 at 4:43 PM, ZsZs <[email protected]> wrote:

> Hi,
>
> I'd like to have the following behavior:
>
> var MyGenericClass = new Class({getClass: function(){ ... }});
> var myObject = new MyGenericClass();
> assertEquals( "MyGenericClass", myObject.getClass() );
>
> How should I implement getClass?
> I tried:
> this.constructor.toString().match( /function (\w+)\(.+/ )[1];
> which worked for ordinary objects but doesn't works with MooTools
> objects?
>
> Thank you,
> Zsolt
>
> I know I'm too much Java oriented, I'd like to reuse the patters
> worked for me on server side. Sorry.




-- 
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

Reply via email to