Hi icarus.wings, Check the MDC doc about functions at : https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Function
and more particulary the caller property inherited from Functions.prototype. It is flagged at non-standard, but work in IE andd FF, and I think, but can't test, in all other browser. it permit to now if a function is directly call or if it is called inside a function. for the use of the wrapper function, it could be interresting, but depending on the number of deprecated method, it can be very long !! -- david On 6 mar, 05:07, "icarus.wings" <absentee.landl...@gmail.com> wrote: > i'm using the Function.wrap() method in a utility I am greating for my > company that does something similar to the prototype update helper, > but more specific to my companies needs. > > we are in the middle of a big move from a very messy pile of copy and > pasted javascript functions to using prototype and I want to be able > to notify users when they are using a deprecated method from our old > codebase which i can easily do as per the update helper utility, > > BUT, i also want to be able to distinguish between direct calls to a > method and nested calls to a method. because if i call a deprecated > method that has nested calls to another deprecated method I end up in > a loop and get all kinds of timeouts and 'too much recursion' errors. > > with JS, how can i reliably tell if my deprecated method is being > called directly, or if it is being called from within another method? > > appreciate any help with this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---