On Fri, Oct 10, 2014 at 11:14 PM, Jane Chen <[email protected]> wrote:
> One more try:
>
> In my constructor function foo:
>
> static void
> foo(const v8::FunctionCallbackInfo<v8::Value>& args)
> {
>   v8::Isolate* isolate = args.GetIsolate();
>   v8::HandleScope handleScope(isolate);
>   args.GetReturnValue().Set(
>     v8::Local<v8::Function>::Cast(args.This())->New(isolate,bar));
> }
>
>> var f = new Foo();
>> f instanceof Foo;
> false
>
> Now if I change New to NewInstance, I get a crash from V8.  I don't see why
> an instance new'ed from the function still isn't "instanceof" the function.

Jane, I'm not sure what you expect that to do but .This() is an
object, not a function.  You _can_ override the return value but I
don't think you're really supposed to.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to