[#25] instanceof => typeof for functions; lib/
parent
705e228842
commit
fdf630458a
|
@ -623,7 +623,7 @@ exports.prototype.createConcreteCtor = function( cname, members )
|
|||
attachInstanceId( this, ++_self._instanceId );
|
||||
|
||||
// call the constructor, if one was provided
|
||||
if ( this.__construct instanceof Function )
|
||||
if ( typeof this.__construct === 'function' )
|
||||
{
|
||||
// note that since 'this' refers to the new class (even
|
||||
// subtypes), and since we're using apply with 'this', the
|
||||
|
@ -747,7 +747,7 @@ exports.prototype._attachPropInit = function(
|
|||
// first initialize the parent's properties, so that ours will overwrite
|
||||
// them
|
||||
var parent_init = prototype.___$$parent$$.__initProps;
|
||||
if ( parent_init instanceof Function )
|
||||
if ( typeof parent_init === 'function' )
|
||||
{
|
||||
// call the parent prop_init, letting it know that it's been
|
||||
// inherited so that it does not initialize private members or
|
||||
|
|
|
@ -323,7 +323,7 @@ exports.propParse = function( data, options )
|
|||
);
|
||||
}
|
||||
// method
|
||||
else if ( value instanceof Function )
|
||||
else if ( typeof value === 'function' )
|
||||
{
|
||||
callbackMethod.call(
|
||||
callbackMethod,
|
||||
|
@ -381,7 +381,7 @@ exports.createAbstractMethod = function()
|
|||
*/
|
||||
exports.isAbstractMethod = function( func )
|
||||
{
|
||||
return ( ( func instanceof Function ) && ( func.abstractFlag === true ) )
|
||||
return ( ( typeof func === 'function') && ( func.abstractFlag === true ) )
|
||||
? true
|
||||
: false
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue