Re: [v8-users] Re: Intercepting the setting of static and instance methods

2020-03-04 Thread Darin Dimitrov
I was able to achieve this by exposing some internal functionality. Normally there's already a SetHandler method on a FunctionTemplate but it is not available in the public API: https://source.chromium.org/chromium/chromium/src/+/master:v8/src/objects/templates-inl.h;l=72;drc=b892cf58e162a8f66cd

Re: [v8-users] Re: Intercepting the setting of static and instance methods

2020-03-03 Thread Darin Dimitrov
Ben, yes, unfortunately the SetAccessor method doesn't allow intercepting the setting of any arbitrary member (property or function) on the function. On Tuesday, March 3, 2020 at 11:21:00 PM UTC+2, Ben Noordhuis wrote: > > On Tue, Mar 3, 2020 at 1:20 PM Darin Dimitrov > wrote: > > > > I tried

Re: [v8-users] Re: Intercepting the setting of static and instance methods

2020-03-03 Thread Ben Noordhuis
On Tue, Mar 3, 2020 at 1:20 PM Darin Dimitrov wrote: > > I tried every possible method but cannot intercept setting members on a > Local instance. Also couldn't find any example in the > https://chromium.googlesource.com/v8/v8/+/refs/heads/lkgr/test/cctest/test-api-interceptors.cc > > Is this si

[v8-users] Re: Intercepting the setting of static and instance methods

2020-03-03 Thread Darin Dimitrov
I tried every possible method but cannot intercept setting members on a Local instance. Also couldn't find any example in the https://chromium.googlesource.com/v8/v8/+/refs/heads/lkgr/test/cctest/test-api-interceptors.cc Is this simply not possible? On Monday, March 2, 2020 at 11:32:50 AM UT

[v8-users] Re: Intercepting the setting of static and instance methods

2020-03-02 Thread Darin Dimitrov
I managed to intercept the setting of the instance method with the following: myClassTemplate->PrototypeTemplate()->SetHandler( NamedPropertyHandlerConfiguration(nullptr, [](Local property, Local< Value> value, const PropertyCallbackInfo& info) { printf("This will be called when setting the i