Created
January 24, 2012 13:19
-
-
Save zmcartor/1670138 to your computer and use it in GitHub Desktop.
JS Mixin
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
var RoundButton = function(radius, label, action) { | |
this.radius = radius; | |
this.label = label; | |
this.action = action; | |
this.StuffSp = 'hoho'; | |
}; | |
var someStuff = function(){ | |
if(this.hasOwnProperty('StuffSpace')){ | |
throw "not good!!"; | |
return; | |
} | |
this.StuffSpace = { | |
ballz: function(){ console.log('baller!'); } | |
} | |
} | |
//mixin this stuff! | |
someStuff.call(RoundButton.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment