2 * Mark a JavaScript function as deprecated
4 * This will print a warning to the JavaScript console (if available) in
5 * Firebug and Chrome and a stack trace (if available) to easily locate the
6 * problematic function call.
8 * @param msg optional message to print
10 function DEPRECATED(msg){
11 if(!window.console) return;
15 if(arguments.callee) func = arguments.callee.caller.name;
16 if(func) func = ' '+func+'()';
17 var line = 'DEPRECATED function call'+func+'. '+msg;
25 if(console.trace) console.trace();
29 * Construct a wrapper function for deprecated function names
31 * This function returns a wrapper function which just calls DEPRECATED
32 * and the new function.
34 * @param func The new function
35 * @param context Optional; The context (`this`) of the call
37 function DEPRECATED_WRAP(func, context) {
40 return func.apply(context || this, arguments);