Extend setter default object
问题 Like you all know a button is a button... click, up, down, do this, do that. So I wrote some default button behavior "class/object". external default button.js: function Button(parent) { var self = this; this.enabled = true; this.visible = true; ... this.initialized = false; f_createButton(parent, self); this.initialized = true; ... } Button.prototype = { get initialized () { return this._initialized; }, set initialized(bool){ this._initialized = bool if(this.initialized === true) { ... do