Thanks Stephen!
On Jul 16, 4:30 pm, Stephan Beal <[email protected]> wrote: > On Thu, Jul 16, 2009 at 9:56 PM, Ravi <[email protected]> wrote: > > > Using Interceptors, is there anyway to figure out the arguments 'arg1' > > and 'arg2' on 'method1', or will I have to add a function callback > > after knowing (in the interceptor) that it's trying to invoke a method > > called 'method1'. > > The interceptors never see the arguments. The call: > > obj.method(arg1,arg2) > > is logically a few different parts: > > a) call interceptor for obj['method']. This part you can intercept in client > code. > b) Ensure that the property is-a callable type. If not, throw an error. > c) Evaluate the arguments (in an unspecified order, AFAIK) and push them > onto an arguments list. > d) call the result of (a), passing it the arguments list. > > To intercept part (d) you have to (re)implement the function pointed to by > obj.method. > > -- > ----- stephan bealhttp://wanderinghorse.net/home/stephan/ --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
