permission: support URL and Uint8Array as has()/drop() reference - #65492
permission: support URL and Uint8Array as has()/drop() reference#65492nhjbest22 wants to merge 1 commit into
Conversation
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65492 +/- ##
==========================================
+ Coverage 90.11% 90.14% +0.03%
==========================================
Files 752 751 -1
Lines 251861 252647 +786
Branches 47365 47549 +184
==========================================
+ Hits 226955 227745 +790
+ Misses 16238 16192 -46
- Partials 8668 8710 +42
🚀 New features to boost your workflow:
|
6d518fc to
72717a5
Compare
normalizeReference() adds URL and Uint8Array support to has()/drop(); the existing string/Buffer behavior is unchanged. BufferValue replaces Utf8Value so a Buffer/TypedArray reference is copied as raw bytes instead of a lossy UTF-8 conversion. Signed-off-by: seungmin Nam <nhjbest22@g.skku.edu>
72717a5 to
42241f8
Compare
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.
This comment was marked as outdated.
This comment was marked as outdated.
|
In repeat runs of Jenkins https://ci.nodejs.org/job/node-test-pull-request/76438/
also in multiple
This will need investigation. Edit: #65554 describes and attempts to fix the flaky tests |
|
It looks like the sea failures are also occurring without this PR, so this would also be test flake. |
|
The flaky tests were confusing the results. I've just started a completely new Jenkins CI run to see if we can get a green result. In parallel there are other people looking at solving the flaky tests as these are having a general impact on processing PRs, not just yours. |
process.permission.has()/drop() only accepted a string or Buffer for
the
referenceargument. This adds support for a WHATWG URL, resolvedvia fileURLToPath() for fs.* scopes since those are the only scopes
that actually use the reference value, and a plain Uint8Array.
Also switches permission.cc from Utf8Value to BufferValue when reading
a Buffer/TypedArray reference, since Utf8Value forces a UTF-8 string
conversion that can silently corrupt a path that isn't valid UTF-8.