diff --git a/lib/ClassBuilder.js b/lib/ClassBuilder.js index 74f2dc4..0b760aa 100644 --- a/lib/ClassBuilder.js +++ b/lib/ClassBuilder.js @@ -244,14 +244,16 @@ exports.isInstanceOf = function( type, instance ) return false; } - // check prototype chain (will throw an error if type is not a - // constructor (function) - if ( ( typeof type === 'function' ) - && ( instance instanceof type ) - ) + try { - return true; + // check prototype chain (will throw an error if type is not a + // constructor (function) + if ( instance instanceof type ) + { + return true; + } } + catch ( e ) {} // if no metadata is available, then our remaining checks cannot be // performed