I want to know if is there a way to access the structure of prototype or json or some javascript internal api...
for call a function when a variable changes, then I will be able to do this:
var subject = 1;
whenChanges(subject, function(newvalue){
alert("subject value changes to: "+ newvalue);
});
subject = 2; //now we call the callback function declared before
I dont want to call this only when changing the variable by a setter and want to monitore all the variables
EDIT:
well, I implemented a fork of object.watch library that can be downloaded here: http://watch.k6.com.br