Skip to content

node-api: use WriteV2 in napi_get_value_string_utf16 #58165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tniessen
Copy link
Member

@tniessen tniessen commented May 4, 2025

Since String::Write() is deprecated, use String::Write2() instead. That requires us to compute the correct number of characters ahead of time but removes the need for dealing with the return value.

@tniessen tniessen added c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency. node-api Issues and PRs related to the Node-API. labels May 4, 2025
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/node-api

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label May 4, 2025
Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (6de55f7) to head (da6a60e).
Report is 101 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58165      +/-   ##
==========================================
+ Coverage   90.17%   90.23%   +0.05%     
==========================================
  Files         630      633       +3     
  Lines      186503   186807     +304     
  Branches    36614    36665      +51     
==========================================
+ Hits       168187   168565     +378     
+ Misses      11124    11041      -83     
- Partials     7192     7201       +9     
Files with missing lines Coverage Δ
src/js_native_api_v8.cc 76.55% <100.00%> (+0.02%) ⬆️

... and 86 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.

@vmoroz
Copy link
Member

vmoroz commented May 4, 2025

Could you also replace the other deprecated Write functions in this file - the WriteOneByte and WriteUtf8?

@tniessen tniessen removed the v8 engine Issues and PRs related to the V8 dependency. label May 8, 2025
Since `String::Write()` is deprecated, use `String::Write2()` instead.
That requires us to compute the correct number of characters ahead of
time but removes the need for dealing with the return value.
@tniessen tniessen force-pushed the napi_get_value_string_utf16-writev2 branch from 86f6bee to da6a60e Compare May 13, 2025 21:47
Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

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

LGTM

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label May 15, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 15, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
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 the Node-API.
Projects
Status: Need Triage
Development

Successfully merging this pull request may close these issues.

6 participants