nodejs / nodejs/nan

`node::MakeCallback()` API change for v6

Open
#548 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.4k
Forks
531
Avg merge
21m
Merged PRs (30d)
1

Description

Currently node::MakeCallback() returns Local<Value>. This is problematic for two reasons:

  1. node::AsyncWrap::MakeCallback() returns a Local<Value>() if there's an exception. While the PR hasn't been done, before v6 it will return a MaybeLocal<Value>.
  2. Recursive MakeCallback() calls depends on knowing if an exception was thrown. This is impossible to do since Undefined() is a valid return value.

It should be easy to get around this for backwards compatibility, but would like to make sure nan is ready for the change.

/cc @nodejs/addon-api

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.

Research direction

Start by reviewing the node::MakeCallback() and node::AsyncWrap::MakeCallback() entry points and the current nan compatibility surface. Determine how the Node.js v6 return-type and exception-signaling changes affect existing callers. Done means nan supports the changed API while preserving backwards compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, node.js
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.