[Question] Why are the return values of the two functions different?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 32/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp, nodejs
- Domain
- api, documentation
Research direction
Compare the linked myobject.cc sections for 7_factory_wrap and 6_object_wrap, starting with the NewInstance implementation and its use of escape scope. Read the surrounding Node-API example code to determine the intended lifetime behavior, then document why the return paths differ and clarify the examples if needed.
Written by the indexing model from the issue text.
Description
I'm Newby, who just got into NAPI.
In the above two codes, methods are create and return the object.
I wonder why only the return value in NewInstance uses escape scope.
- Dominant language
- C++
- Stars
- 2.6k
- Forks
- 602
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/node-addon-examples
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
nodejs/node-addon-examples#585 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
nodejs/node-addon-examples#530 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
nodejs/node-addon-examples#445 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nodejs/node-addon-examples#381 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nodejs/node-addon-examples#380 · 2 comments ·
All issues in nodejs/node-addon-examples
Similar issues
-
[BUG] Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
eunomia-bpf/llvmbpf#51 · 1 comment ·
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PX4/PX4-Autopilot#28776 ·
-
Website Doc Typo Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100