Created
July 15, 2014 14:22
-
-
Save bwiggs/306ba0eb6a79b19b1c1a to your computer and use it in GitHub Desktop.
ConstructorProxy.js
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 Person() { | |
this.name = 'Bob' | |
} | |
constructorProxy = (constructorFn, args) -> | |
Proxy = -> | |
constructorFn.apply(this, args) | |
this.name = 'Dave' | |
Proxy:: = Object.create constructorFn:: | |
Proxy | |
constructorProxy Person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment