dcl.isInstanceOf()
Version 1.x
While instanceof
operator works only for linear prototypal inheritance, dcl.isInstanceOf()
is
its counterpart for mixins.
Description
JavaScript provides instanceof
operator to check if an object was produced with a certain constructor or its delegate.
Unfortunately this functionality works only for a linear delegation. Mixins are by necessity mixed in, so they cannot be
detected by instanceof
. This functionality is provided by dcl.isInstanceOf()
function, which takes an object and
a constructor as parameters, and returns a Boolean value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Notes
This function has a linear complexity on a number of mixins.