incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <pmue...@gmail.com>
Subject Re: `instanceof` considered harmful in cordova-js
Date Fri, 27 Apr 2012 18:46:01 GMT
On Fri, Apr 27, 2012 at 14:29, Jesse <purplecabbage@gmail.com> wrote:

>    if ( !f || !f.apply ) { return; }
>

is more fragile than this

    if (typeof f != "function") {return; }

Sure, "it's never going to happen" that someone sends in an object with an
apply property which isn't a function.  Sure.  :-)

But more so, it's understandable.  The f.apply() test - I can't really tell
what it's testing for there.

-- 
Patrick Mueller
http://muellerware.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message