C++ object prototype still not working

38 views
Skip to first unread message

kent williams

unread,
Dec 21, 2016, 12:33:02 PM12/21/16
to v8-users
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.

tbl...@icloud.com

unread,
Jan 7, 2017, 5:58:23 PM1/7/17
to v8-users
I've got a V8 library on github that isn't abandoned: https://github.com/tbodt/v8py. I've gotten pretty much everything to work with it. It's a Python extension module, though...

Hope this helps.
~Theodore
Reply all
Reply to author
Forward
0 new messages