Skip to content

lib: make SubtleCrypto.supports enumerable#62307

Open
panva wants to merge 2 commits intonodejs:mainfrom
panva:subtle-supports-enumerable
Open

lib: make SubtleCrypto.supports enumerable#62307
panva wants to merge 2 commits intonodejs:mainfrom
panva:subtle-supports-enumerable

Conversation

@panva
Copy link
Member

@panva panva commented Mar 18, 2026

Per WebIDL § 3.7.7, static operations use the same "define the operations" algorithm as regular operations:

To define the operations operations of interface or namespace definition on target, given realm realm, run the following steps:

  1. For each operation op of operations:
    1. If op is not exposed in realm, then continue.
    2. Let method be the result of creating an operation function given op, definition, and realm.
    3. Let modifiable be false if op is unforgeable and true otherwise.
    4. Let desc be the PropertyDescriptor{[[Value]]: method, [[Writable]]: modifiable, [[Enumerable]]: true, [[Configurable]]: modifiable}.
    5. Let id be op's identifier.
    6. Perform ! DefinePropertyOrThrow(target, id, desc).

The [[Enumerable]]: true in step 4 applies to both regular and static operations. JavaScript static class methods are non-enumerable by default, so we need to explicitly set enumerable: true on SubtleCrypto.supports to match the spec just like we do with all other prototype methods.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Mar 18, 2026
@panva panva added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 18, 2026
@nodejs-github-bot

This comment was marked as outdated.

@panva
Copy link
Member Author

panva commented Mar 18, 2026

Refs: web-platform-tests/wpt#58579
Refs: nodejs/node-core-utils#1038 (please approve)

@nodejs-github-bot

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.68%. Comparing base (4d2d6de) to head (cd9fc6d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62307      +/-   ##
==========================================
+ Coverage   89.66%   89.68%   +0.01%     
==========================================
  Files         676      676              
  Lines      206575   206579       +4     
  Branches    39555    39552       -3     
==========================================
+ Hits       185225   185264      +39     
+ Misses      13501    13446      -55     
- Partials     7849     7869      +20     
Files with missing lines Coverage Δ
lib/internal/crypto/webcrypto.js 96.37% <100.00%> (+<0.01%) ⬆️

... and 45 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
Collaborator

@panva panva added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants