Created
July 21, 2016 08:12
-
-
Save peterli888/e2f193fdeb4da6c9a1254f81adc64332 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
from: https://github.com/montagejs/mr/blob/master/browser.js | |
// Here we use a couple tricks to make debugging better in various browsers: | |
// TODO: determine if these are all necessary / the best options | |
// 1. name the function with something inteligible since some debuggers display the first part of each eval (Firebug) | |
// 2. append the "//# sourceURL=location" hack (Safari, Chrome, Firebug) | |
// * http://pmuellr.blogspot.com/2009/06/debugger-friendly.html | |
// * http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/ | |
// TODO: investigate why this isn't working in Firebug. | |
// 3. set displayName property on the factory function (Safari, Chrome) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment