Re: Is jQuery worth a second look?



On Sep 30, 5:06 pm, Oltmans wrote:
On Sep 30, 6:38 pm, "Thomas 'PointedEars' Lahn" wrote:
kangax wrote:
dhtml wrote:
isFunction - still uses function decompilation. Kangax posted on
es-discuss that that was changed but I still see the isFunction in the
latest 1.2.6.

Garrett,
their trunk is using `instanceof` [1].

Irrelevant, except that it shows their cluelessness.

Why using "instanceof" considered to be not so good? Can you
please explain it to me with a few examples? That will be
highly appreciated.

The - instanceof - operator makes assertions about the runtime
relationships between the objects on the prototype chain of one object
and that object that is the value of the - prototype - property of a
(single) function object. Because it is possible, at any time, to
create objects with virtually any other object on their prototype
chain, and to assign to the - prototype - properties of most functions
(though not the built-in constructors) that relationship is only as
meaningful as to can be know to be. It is in the nature of library
code that it has no control over, or knowledge about, the code that
employs it or sits around it, and so no guarantee of the usefulness/
applicability of the relationship being tested.
.



Relevant Pages

  • Re: inheritance issue, seems to be sharing data incorrectly
    ... (And things can be overridden with the prototype or within the AList() ... The only real question is how is it that instanceof 'breaks' under ... the David Crockford style of inheritance seemed ...
    (comp.lang.javascript)
  • Re: calling a method from a method
    ... by that constructor, as demonstrated by the 'instanceof' operator. ... When methods are properties of prototype objects you can say they are ... javascript is a very flexible language. ...
    (comp.lang.javascript)
  • Re: Prototype and instanceof
    ... I was playing a bit with prototype to find some alternative ways to do ... var obj = new subClass; ... The expression "cat1 instanceof Cat" causes a search through the ...
    (comp.lang.javascript)
  • Re: How instanceof works?
    ... defines the behaviour required of ECMAScript implementations (which is ... exactly what - instanceof - can be expected to do. ... be on the internal prototype chain of objB. ... alert(objB instanceof ObjA); // true ...
    (comp.lang.javascript)
  • Re: How instanceof works?
    ... the 'instanceof' operator works in javascript? ... exactly what - instanceof - can be expected to do. ... identity of the current value of a function's - prototype - property ... ;', the statement 'alert(d instanceof Base);' indeed ...
    (comp.lang.javascript)