[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread Anoop R. S.
Hi, I read around a bit and did some changes. Instead of using an *ObjectTemplate *directly, for wrapping the C++ object, I created a *FunctionTemplate *first, used *SetClassName()* and then called *InstanceTemplate()* to create an *ObjectTemplate *from it. All handlers were set on this

[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread Anoop R. S.
Thank you for your reply, ibon. I am using *FunctionTemplate *to expose the keyword '*Point*'. So, it will call the function registered with the *FunctionTemplate*. In that function, I am using *ObjectTemplate* to wrap the C++ object and return. For the *ObjectTemplate*, I am setting the

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-05-21 Thread Abhishek Kanike
Sorry JaKob On Mon, May 21, 2018, 6:51 PM Abhishek Kanike wrote: > Cool.. I see it. Thanks a lot Jacob. > > On Mon, May 21, 2018, 5:40 PM Jakob Kummerow > wrote: > >> The time always has to be retrieved from the kernel. V8's implementation >>

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-05-21 Thread Abhishek Kanike
Cool.. I see it. Thanks a lot Jacob. On Mon, May 21, 2018, 5:40 PM Jakob Kummerow wrote: > The time always has to be retrieved from the kernel. V8's implementation > is in base::OS::TimeCurrentMillis, implemented in > src/base/platform/platform-{win32,posix}.cc. > > On

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-05-21 Thread Jakob Kummerow
The time always has to be retrieved from the kernel. V8's implementation is in base::OS::TimeCurrentMillis, implemented in src/base/platform/platform-{win32,posix}.cc. On Mon, May 21, 2018 at 3:22 PM Abhishek Kanike wrote: > Hi, > I want to know how the date.now()

[v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-05-21 Thread Abhishek Kanike
Hi, I want to know how the date.now() function is called in javascript (or how it returns the value). I believe that javascript uses date.now() by system call. I want to in chrome source code how it is being set. This is useful for one of the performance benchmark that I am working on. Can

[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread ibon
Have you tried setting the class name in the FunctionTemplate ? interface_template->SetClassName( v8::String ) This names my objects as expected. I also get [object MyObject] instead of [object Object] when calling Object's prototype toString. You also might want to name the prototype by