hamburgerwang hamburgerwang

View object-watch.js
1 2 3 4 5 6 7 8 9 10
// Cross-browser object.watch and object.unwatch
 
// object.watch
if (!Object.prototype.watch) {
Object.prototype.watch = function (prop, handler) {
var oldval = this[prop], newval = oldval,
getter = function () {
return newval;
},
setter = function (val) {
Something went wrong with that request. Please try again.