detecting jQuery objects && "constructor" property

detecting jQuery objects && "constructor" property


Hi,
I first posted this message on the jquery-en group, but it should
probably be posted here, so here am I.
In some cases, I have to check if a variable is a jQuery object or
not. Usually, to check a variable type, I use the "constructor"
property
(when I can't use typeof, which is not accurate).
In case of jQuery, the constructor property equals Object, so I can't
use it.
When I create a jQuery Object, it's known by javascript as an object,
and it behaves like a function.
Would it be possible to add something so we could get a true with this
example :
$([]).constructor === jQuery
This would be great, no ?? The only change to do is to add in the
beginning of jQuery.fn.init method the line :
this.constructor = jQuery;
This way, all jQuery's objects "constructor" property equals jQuery. I
quickly tried this, and I met no bugs.
Any arguments against this ?
Nico