On Sat, Apr 16, 2011 at 5:04 AM, crtmpserver <[email protected]> wrote:
> and the pointConstructor function is this:
>
> Handle<Value> pointConstructor(const Arguments& args) {
> Handle<Object> result = _pointFunctionTemplate->PrototypeTemplate()-
> >NewInstance();
>
That doesn't look right to me. The constructor is normally called
_in_response_to_ NewInstance(), whereas you're calling NewInstance() from
within the constructor. i'm surprised that doesn't end in an endless loop.
Also be aware that with the above code, if you do this in JS:
var p = Point(...); // without 'new'
then v8 will crash. You can check if the ctor was called with 'new'. See:
http://code.google.com/p/v8-juice/source/browse/convert/include/v8/convert/ClassCreator.hpp#496
for an example. (Yes, that code _also_ calls NewInstance() from the ctor,
but as a workaround for the 'new' part.)
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users