FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add Object::New overload utilizing node_api_create_object_with_properties by KevinEady · Pull Request #1735 · nodejs/node-addon-api · GitHub

feat: add Object::New overload utilizing node_api_create_object_with_properties - #1735

Open
KevinEady wants to merge 1 commit into
mainfrom
add-node_api_create_object_with_properties
Open

feat: add Object::New overload utilizing node_api_create_object_with_properties#1735
KevinEady wants to merge 1 commit into
mainfrom
add-node_api_create_object_with_properties

Conversation

Copy link
Copy Markdown
Contributor

Add Object::New overload utilizing node_api_create_object_with_properties

KevinEady moved this from Need Triage to In Progress in Node-API Team Project Jun 5, 2026
KevinEady force-pushed the add-node_api_create_object_with_properties branch 4 times, most recently from bbf03d9 to ef2601b Compare June 5, 2026 13:24

codecov-commenter commented Jun 5, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.69%. Comparing base (7223518) to head (23b62a9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1735   +/-   ##
=======================================
  Coverage   63.69%   63.69%           
=======================================
  Files           3        3           
  Lines        2063     2063           
  Branches      730      730           
=======================================
  Hits         1314     1314           
  Misses        162      162           
  Partials      587      587           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

legendecas commented Jun 12, 2026
edited
Loading

Copy link
Copy Markdown
Member

The CI failure is nodejs/node-gyp#3327

KevinEady force-pushed the add-node_api_create_object_with_properties branch 2 times, most recently from eb9b7ef to e725910 Compare July 31, 2026 13:02
KevinEady marked this pull request as draft July 31, 2026 13:02
KevinEady force-pushed the add-node_api_create_object_with_properties branch from e725910 to 23b62a9 Compare July 31, 2026 14:30
KevinEady marked this pull request as ready for review July 31, 2026 14:30
KevinEady requested a review from legendecas July 31, 2026 14:30
Comment thread napi-inl.h
std::vector<napi_value>& propertyNames,
std::vector<napi_value>& propertyValues) {
if (propertyNames.size() != propertyValues.size()) {
Napi::Error::New(env, "Mismatch in size of property names and values")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should prefer NAPI_THROW to throw as a c++ exception when it is enabled:

Suggested change
Napi::Error::New(env, "Mismatch in size of property names and values")
NAPI_THROW(
Napi::Error::New(env, "Mismatch in size of property names and values"),
Object());

Comment thread napi.h
Comment on lines +911 to +912
std::vector<napi_value>& propertyNames, ///< Property names
std::vector<napi_value>& propertyValues ///< Property values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This could take const vectors:

Suggested change
std::vector<napi_value>& propertyNames, ///< Property names
std::vector<napi_value>& propertyValues ///< Property values
const std::vector<napi_value>& propertyNames, ///< Property names
const std::vector<napi_value>& propertyValues ///< Property values

legendecas linked an issue Aug 12, 2026 that may be closed by this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Porting create_object_with_properties

3 participants


Back | FazBrowse Home | New Git URL