//Break on property change (function () { var localValue; Object.defineProperty(targetObject, ‘propertyName‘, { get: function() { //any access to the target property will call this method return localValue; }, set: function(val) { //any modification to the target property will call this method localValue = val; debugger; } }); }());
Object.defineProperty(demo,‘foobar‘,{ get:function(){ return v; }, set:function(e){ v = e; sow(); }} ); function sow(){ $(‘body‘).html(demo.foobar) }
get: function () { throw new Error(‘Most middleware (like ‘ + name + ‘) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.‘); }
跟踪对象属性值的修改, 设置断点(Break on property change)
原文:http://www.cnblogs.com/gentlemint/p/5177089.html