The way you do it is by making the constructor a C++ function. A bit of reference on how to do this is in the following places: The v8 embedder's guide
The example files in the v8 source tree My own article which covers some of the techniques to wrap v8 objects: http://create.tpsitulsa.com/blog/2009/01/29/v8-objects/ Also, as far as I know there is no way to intercept operators. Hope that helps, Alex Sent from Alex's iPhone On Apr 2, 2009, at 10:26 AM, MJ <[email protected]> wrote: > > This is kind of a 2 part question. > > 1) Are you able to get a class created in script in C++ and create an > object of that type in C++ and then push it back to script? Like can > you get the function from the engine and get the instance template > from it and create a new instance. > > function MyClass() > { > } > > And then in C++ get MyClass and create an instance of it? > > 2) Also, is it possible to override or intercept operators? > > --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
