X = function() {} Y = function() {} X.prototype.method = function() { alert( 'ok' ) }; y = new Y; y.constructor.prototype = new X; alert( y instanceof Y ); alert( y instanceof X );