Skip to content

Instantly share code, notes, and snippets.

@atdt
Forked from paulirish/moved.md
Created April 20, 2013 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atdt/5427547 to your computer and use it in GitHub Desktop.
Save atdt/5427547 to your computer and use it in GitHub Desktop.
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
set: function(val) {
debugger;
return origValue = val;
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment