1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| if(!Object.prototype.bind){ Object.prototype.bind = function(key, callback){ var _key = "_" + key; Object.defineProperty(this, key, { get: function(){ return this[_key]; }, set: function(value){ if(value !== this[_key]){ this[_key] = value; callback(); } } }); } }
|