Another quick question:
I am customizing the FunctionTemplate of a constructor, so that the
constructed objects have the necessary bindings. However, I still have
my C++ callback called by the js constructor, so that I can create the
native part and set the object's internal fields. The question is -
from what object template should I create the objects? Is this legal:

//Here is how I create the constructor
        Handle<FunctionTemplate> ctor = FunctionTemplate::New(jsCtorCallback,
External::New(userdata));
        Handle <ObjectTemplate> objTempl = ctor->PrototypeTemplate();
        customizeObjectTemplate(objTempl);

//Later, from inside the the ctor callback, I try to create the object
with:
        objTempl->NewInstance();
where objTempl is cached in a Persistent<ObjectTemplate> handle in my
code.
However, when the constructor callback returns, the app crashes with
access violation. It seems I am doing it wrong, but what exactly?

Thanks
Alex

On Sep 22, 3:15 pm, Stephan Beal <[email protected]> wrote:
> On Thu, Sep 22, 2011 at 2:12 PM, avasilev <[email protected]> wrote:
> > Wow, was it intended for that purpose?
>
> If it was documented i could answer that. (HINT! HINT!!!!)
>
> I have seen this parameter, but
>
> > didn't know what it is for.
>
> i just guessed and it happened to work.
>
> --
> ----- stephan bealhttp://wanderinghorse.net/home/stephan/

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to