Skip to content

node-api: make object property arrays const - #65621

Open
umuoy1 wants to merge 1 commit into
nodejs:mainfrom
umuoy1:node-api-object-properties-const
Open

node-api: make object property arrays const#65621
umuoy1 wants to merge 1 commit into
nodejs:mainfrom
umuoy1:node-api-object-properties-const

Conversation

@umuoy1

@umuoy1 umuoy1 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Make property_names and property_values const in node_api_create_object_with_properties() to match their read-only semantics.

Refs: nodejs/node-addon-api#1735 (comment)

Signed-off-by: umuoy1 <burningdian@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/node-api

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. node-api Issues and PRs related to Node-API. labels Aug 28, 2026
@legendecas

legendecas commented Aug 28, 2026

Copy link
Copy Markdown
Member

Thanks! FWIW, this API has already been documented as taking const napi_value* property_[names|values] in https://github.com/nodejs/node/blob/main/doc/api/n-api.md?plain=1#L2697-L2702

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 28, 2026
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (0544741) to head (d7027a1).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65621      +/-   ##
==========================================
- Coverage   90.07%   90.05%   -0.02%     
==========================================
  Files         751      751              
  Lines      254921   254921              
  Branches    48129    48127       -2     
==========================================
- Hits       229627   229578      -49     
- Misses      16479    16513      +34     
- Partials     8815     8830      +15     
Files with missing lines Coverage Δ
src/js_native_api_v8.cc 76.63% <ø> (ø)

... and 29 files with indirect coverage changes

🚀 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.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. node-api Issues and PRs related to Node-API.

Projects

Status: Need Triage

Development

Successfully merging this pull request may close these issues.

4 participants