permission: reuse cached env strings - #64912
Open
agape1225 wants to merge 1 commit into
Open
Conversation
Permission::is_scope_granted() and Permission::Drop() built the "permission" and "resource" diagnostics message keys with FIXED_ONE_BYTE_STRING(isolate, ...) on every publish, even though Environment already caches these exact strings via env->permission_string() and env->resource_string() (src/env_properties.h). One call site in the same file already used the cached accessor; these two did not, and Environment is already in scope at both sites. Assisted-by: Claude Sonnet 5 Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64912 +/- ##
==========================================
- Coverage 90.29% 90.27% -0.03%
==========================================
Files 760 760
Lines 247061 247061
Branches 46585 46587 +2
==========================================
- Hits 223092 223035 -57
- Misses 15451 15496 +45
- Partials 8518 8530 +12
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Aug 2, 2026
leah-1ee
added a commit
to leah-1ee/node
that referenced
this pull request
Aug 5, 2026
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>
leah-1ee
added a commit
to leah-1ee/node
that referenced
this pull request
Aug 5, 2026
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>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces
FIXED_ONE_BYTE_STRING(isolate, "...")literals insrc/permission/permission.ccwith the Environment-cachedpermission_string()/resource_string()accessors already usedelsewhere in the same file. Follow-up to #59891, which didn't cover
this file.