[Laszlo-dev] isSubclassOf [Was: Detecting classes]

P T Withington ptw at pobox.com
Mon Jan 18 09:37:25 PST 2010


Of course, here is the simplest (although perhaps not most efficient) implementation:

  function isSubclassOf (a, b) { return new a is b; }

It sucks that in as3, `new a is b` does not imply `a.prototype is b`.  as3 seems to take the approach that the prototype of a class is an instance of the class, but somehow not an instance of the superclass!  More bizarrity.


More information about the Laszlo-dev mailing list