From ee94499951d43d07fa5822b968f594c1f5932613 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 8 Jul 2011 11:37:01 +0200 Subject: more robust deprecation messages --- lib/scripts/script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/script.js b/lib/scripts/script.js index fc8cb6096..24473c2e6 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -14,10 +14,12 @@ if ('function' === typeof jQuery && 'function' === typeof jQuery.noConflict) { */ function DEPRECATED(msg){ if(!window.console) return; - if(!arguments.callee) return; + if(!msg) msg = ''; - var func = arguments.callee.caller.name; - var line = 'DEPRECATED function call '+func+'(). '+msg; + var func; + if(arguments.callee) func = arguments.callee.caller.name; + if(func) func = ' '+func+'()'; + var line = 'DEPRECATED function call'+func+'. '+msg; if(console.warn){ console.warn(line); -- cgit v1.2.3