I think this has been way more frustrating than it should be.
I've done a LOT of googling to figure this out, and gotten some advice from people on this list and I still don't have a working version of this.
My spec is simple: I want to create an object type that will encapsulate private data, and define a number of methods to manipulate the private data.
My current version:
https://gist.github.com/Chaircrusher/48d53ee78567ca213f7a858e91e4771d
Right now it compiles with errors and runs. The constructor is called, the constructor is called, but the methods to the object are apparently not installed properly.
There 3is a problem here, and I can't believe it's just me.
1. The Embedder's guide has no comprehensive working example. Using it as a clue didn't really suggest a solution.
2. Following -- as suggested -- the example in v8/test/cctest/test-api.cc doesn't work (see ConstructorForObject test)
4. There are many moving parts to getting v8 to actually run a script; most of these amount to copying boilerplate code that could (and should!) be encapsulated in some kind of convenience object.
5. There are various libraries littering github, but they seem to be abandoned, usually when an update to v8 broke the api they depended on.