src: reuse cached env strings in remaining files - #65039
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the effort to replace repeated FIXED_ONE_BYTE_STRING(...) literals with Environment/IsolateData-cached strings in the Node.js core C++ sources, improving reuse and consistency without changing behavior.
Changes:
- Reuse
IsolateDatacached"shared"/"exclusive"strings when defining lock mode constants. - Reuse the cached
"errno"string when defining OS constants.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/node_locks.cc | Uses isolate_data->shared_string() / exclusive_string() instead of new fixed string literals when exporting lock mode constants. |
| src/node_constants.cc | Uses env->errno_string() instead of creating a fixed string literal for the "errno" key in OS constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up to nodejs#59891, covering files it missed. Overlapping locations (node_ffi.cc, crypto_util.cc) were already handled by nodejs#64760. Refs: nodejs#59891 Refs: nodejs#64760 Refs: nodejs#64912 Signed-off-by: leah-1ee <selee3196@gmail.com>
90c4c8a to
ae5c463
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65039 +/- ##
=======================================
Coverage 90.30% 90.30%
=======================================
Files 759 759
Lines 247597 247593 -4
Branches 46679 46676 -3
=======================================
+ Hits 223591 223593 +2
- Misses 15469 15471 +2
+ Partials 8537 8529 -8
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@daeyeon Just noticed the CI job has been running for 18+ hours with no status — looks stuck on a specific agent. Could you (or someone with access) abort and restart it when you get a chance? No rush. |
Follow-up to #59891, covering two more locations it missed:
src/node_locks.cc:"shared"/"exclusive"src/node_constants.cc:"errno"Two other candidates (
node_ffi.cc,crypto_util.cc) were alreadycovered by #64760, landed just before this branch was pushed.
No behavior change.
Refs: #59891
Refs: #64760
Refs: #64912