-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS API: initial implementation #147
Conversation
cefb762
to
2922570
Compare
0005a96
to
d7f5d93
Compare
2f35e85
to
d4c3b7f
Compare
(Replied here in case it's buried in folded comments..)
I think it requires root access to dereference the symlink, so I kept this as Also I've tried to merge the two
I prefer option 1. Either way I think it's best to leave the two gyp coexist in this PR for now and merge them later. The tests now pass on Mac and Ubuntu with this command:
Where @bnoordhuis I think I've addressed all the comments, Can you take a look at the non-tests part again? Thanks! |
af84a98
to
c021fd6
Compare
Rebased now that the Travis CI is working. Fixed the syntax and API incompatibility on older versions of V8, also added @bnoordhuis Can you take a look again? Thanks! |
BTW: CI is green https://travis-ci.org/nodejs/llnode/builds/317264211 not sure why the bot does not updating the status in this PR though.. |
Rebased. Ping @bnoordhuis can you review again? Thanks! |
ca01048
to
9aed7ad
Compare
40a14fd
to
e584771
Compare
I have a few more ideas about this after JSConf EU:
|
So I've been working on the things I listed in #147 (comment) , my current design is to spit out everything that we know about the V8 values into JS and let the JS reconstruct objects based on existing knowledge when the users want it to (e.g. by default we return properties and elements of a JSObject, if the user just wants us to return something similar to what it used to be, we construct a new object out of those properties and elements). But it turns out wrapping the V8 values into JS objects is quite a big undertaking that should probably be done in multiple future PRs, because we need to basically reverse all existing code in llv8.h and llv8-inl.h and write a formatter for each type of values. Also the stream idea is less attractive if we use push streams i.e. Node.js streams. Pull streams seem to make a bit more sense but we'd either need to wait for the new Stream API or add a dependency like https://github.com/pull-stream/pull-stream . Either way the current iterator API already works and it should be trivial to implement a pull stream using that iterator. So I think I will just finish the port to N-API and make it the first version of the API ready to land. The current API is not very good if you want to implement any GUI with it since it just gives you a bunch of strings (results of |
Superseded by #206 |
Fixes: #14
Based on the previous work done by @rnchamberlain in #14 (comment)
Overview of the API is documented as JSDoc annotations in JSAPI.md.
Still needs a bit of clean up, but any feedback on the API design would be very welcome!