Ben,

How am I supposed to expose the class to the global object?

I have this:

// create and bind XMLBuilder function
v8::Local<v8::FunctionTemplate> bldrTemp =
v8::FunctionTemplate::New(isolate,createBuilder);
v8::Local<v8::String> bldrLabel =
v8::String::NewFromUtf8(isolate, "XMLBuilder");
bldrTemp->SetClassName(bldrLabel);
global->Set(bldrLabel,bldrTemp);

> var b = new XMLBuilder();
> b instanceof XMLBuilder;
false
> Object.prototype.toString.call(b);
[object XMLBuilder]

On Friday, June 27, 2014 3:22:14 PM UTC-7, Ben Noordhuis wrote:
>
> On Fri, Jun 27, 2014 at 9:29 PM, Jane Chen <[email protected] 
> <javascript:>> wrote: 
> > Ben, 
> > 
> > Say if my class is called ValueIterator, and "it" is an instance of it, 
> if I 
> > do: 
> > 
> >> Object.prototype.toString.call(it); 
> > [object ValueIterator] 
> >> it instanceof ValueIterator; 
> > (shell):1: ReferenceError: ValueIterator is not defined 
> > it instanceof ValueIterator; 
> >               ^ 
> > ReferenceError: ValueIterator is not defined 
> >     at (shell):1:15 
>
> The error message suggests that you called 
> FunctionTemplate::SetClassName() but haven't exposed the class on the 
> global object. 
>

-- 
-- 
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