Created
September 23, 2015 13:50
-
-
Save kariudo/dc99cd278872cbf646e1 to your computer and use it in GitHub Desktop.
Javascript "Todo" Warning (With Caller) Function
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
// Used as a UI indicaiton that a feature is not complete. Warns to log. | |
var TODO = function () { | |
var callerName = ""; | |
try { //noinspection ExceptionCaughtLocallyJS | |
throw new Error(); } | |
catch (e) { callerName = /TODO.+\n\s+at (.+) \(/.exec(e.stack)[1]; } | |
console.warn('Feature not complete:', callerName); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this for alerting in console when I have used a UI feature that has not yet had its functionality completed in the backend