Last active
August 29, 2015 13:57
-
-
Save jasonLaster/9645192 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([], function() { | |
var breakOn = function(object, method) { | |
var originalMethod = object[method]; | |
if (!originalMethod) { | |
throw new Error('Couldnt find method ' + method + ' to break on.'); | |
} | |
return object[method] = function stopExecution() { | |
debugger; | |
return originalMethod.apply(this, arguments); | |
} | |
} | |
return { | |
breakOn: breakOn | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This adds a DevTools module where we can add helpful utilities
logCalls(obj, method)
which could keep a registry of all the calls an object receiveswatch(object)
which could hold onto an object. maybe have some nice view stuffHelp us track down things like: