Function call — which `foo()` an `nsui()` are — has little to do with `Function.prototype.call`. Function call (such as `foo()`) delegates to internal [[Call]] method of whatever object you're invoking. In case of `foo()` it's [[Call]] of `foo` function object. Unless the implementation you're working with allows you to tap into this internal [[Call]] method (and intersect it) overwriting `Function.prototype.call/apply` certainly won't help here.
I don't think I've seen any implementations that expose [[Call]] to user-level code. -- kangax On Thu, Mar 24, 2011 at 4:44 AM, Marc Palau <m...@palaueb.com> wrote: > Hi everybody! > > -Just for Firefox- I'm trying to modify the Function object to output by > console the execution flux of my application, I know firebug can capture for > me that, but I want to modify the Function to play aroud with it. > > My approach is this, but it doesn't work (of course). > > Function.prototype._call = Function.prototype.call; > > Function.prototype.call = function(args){ > console.log(this); > > > Function.prototype._call.apply(args,Array.prototype.slice._call(arguments,1)); > } > > > function foo(){ > return 42; > } > > > var nsui = function(){ > return 42; > } > > foo(); > nsui(); > > //none happens :P > > Thanks in advance! > marc > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/jsmentors@jsmentors.com/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/jsmentors@googlegroups.com/ > > To unsubscribe from this group, send email to > jsmentors+unsubscr...@googlegroups.com > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com