diff options
Diffstat (limited to 'lib/scripts/script.js')
-rw-r--r-- | lib/scripts/script.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js index a673cdc02..8adba829c 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -28,6 +28,21 @@ function DEPRECATED(msg){ if(console.trace) console.trace(); } +/** + * Construct a wrapper function for deprecated function names + * + * This function returns a wrapper function which just calls DEPRECATED + * and the new function. + * + * @param func The new function + * @param context Optional; The context (`this`) of the call + */ +function DEPRECATED_WRAP(func, context) { + return function () { + DEPRECATED(); + return func.apply(context || this, arguments); + } +} /** * Some of these scripts were taken from wikipedia.org and were modified for DokuWiki |