To expose a C++ object to JS, this is about what you want to do:
template = ObjectTemplate::New();
template->SetInternalFieldCount(1);
template->SetAccessor("property", Getter);
// you can actually do this many times, template acts like a class
instance = template->NewInstance();
instance->SetInternalField(0, External::Wrap(myC++Object));
context->Global()->Set("name", instance);
...
Getter(Local<String> property, const Arguments& args) {
HandleScope locals;
X* myC++Object =
static_cast<X*>(External::Unwrap(args->This()->GetInternalField(0)));
...
return locals.Close(result);
}
Now in JS: name.property should call your Getter.
There's some more sophisticated variations on this, e.g. using FunctionTemplate and exposing its function instance to JS, too, so you can attach JS methods to the prototype, but you should start with this.