Skip to content
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

Property accessors #44

Closed
jasongin opened this issue Jan 11, 2017 · 2 comments
Closed

Property accessors #44

jasongin opened this issue Jan 11, 2017 · 2 comments
Assignees
Milestone

Comments

@jasongin
Copy link
Member

NAPI is currently missing support for property accessors, to enable C++ callbacks for getters and setters of properties on a wrapped object.

NAN supports this via the Nan::SetAccessor() function, which eventually calls v8::Object::SetAccessor() or v8::ObjectTemplate::SetAccessor(). NAPI currently has functions for getting and setting property values, but not for setting accessors.

From the data I collected, 5 of the top 12 native packages use one or both of those APIs: canvas, fibers, nodegit, sqlite3, zmq. The canvas module implements accessors for several properties like canvas.width, canvas.height, etc. The sqlite3 module only has a single getter for database.open.

@jasongin
Copy link
Member Author

Fixed in the 6.2 branch with 67f4581

To be ported to other branches soon.

@aruneshchandra aruneshchandra added this to the Milestone 4 milestone Feb 1, 2017
@jasongin
Copy link
Member Author

jasongin commented Feb 1, 2017

Also done in ChakraCore as 27b3fc7 and merged into the V8 8.x branch as 0bdc1b8

@jasongin jasongin closed this as completed Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants