Nan conversion of external type

Open
#95 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, nodejs
Domain
api, backend

Research direction

Start with the shown ext2_filsys cast and the repository's Node.js addon examples, then investigate the Node 12 and Nan conversion guidance referenced in the issue. Done means providing a documented, working example for handling v8::External values during the conversion.

Written by the indexing model from the issue text.

Description

Have a piece of code, that works on node <12, but will need to be converted to for node 12.

return static_cast<ext2_filsys>(
  info[0]->ToObject().As<v8::External>()->Value()
);

I couldn't see any examples for v8::External in conversion (i.e. I'm guessing using it with Nan::To<v8::Object>?)

What would be an example of using such v8::External cases?

Dominant language
C++
Stars
2.6k
Forks
602
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nodejs/node-addon-examples

All issues in nodejs/node-addon-examples

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.