Created
February 28, 2015 10:54
-
-
Save yiwenl/50806a32bb7bfeb1baef to your computer and use it in GitHub Desktop.
Getter / Setter for Javascript function prototype
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
p.__defineGetter__("test", function() { | |
return "testing testing"; | |
}); | |
p.__defineSetter__("test", function() { | |
// DO SOMETHING | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment