Created
July 20, 2012 06:59
-
-
Save ClayShentrup/3149174 to your computer and use it in GitHub Desktop.
beget question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function beget(parent, child){ | |
// put code here to make test() return true | |
}; | |
function test(){ | |
function Parent(){ | |
throw 'exception'; | |
}; | |
Parent.prototype = {code: Math.random()}; | |
function Child(){}; | |
beget(Parent, Child); | |
delete Child.prototype.code; | |
return new Child().code === Parent.prototype.code && | |
Child.prototype !== Parent.prototype; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment