Skip to content

feat(process): implement process.features (#1378) - #1474

Merged
proggeramlug merged 1 commit into
mainfrom
fix/1378-process-features
May 23, 2026
Merged

feat(process): implement process.features (#1378)#1474
proggeramlug merged 1 commit into
mainfrom
fix/1378-process-features

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Node's process.features is an object of boolean capability flags (tls, ipv6, inspector, openssl_is_boringssl, ...) — consumers branch on individual fields to detect what the runtime links in. Perry was returning a 0 sentinel, so reading any field came back undefined.

Closes #1378.

Changes

expr_member.rs: both the bare process.features and globalThis.process.features paths lower to an inline Expr::Object literal built by a new process_features_literal() helper.

Values reflect what Perry's runtime actually supports — tls/ipv6/tls_alpn/tls_sni/tls_ocsp true, inspector/debug/uv/openssl_is_boringssl/cached_builtins/require_module/quic false. typescript: "transform" distinguishes Perry's native (AOT) TS compilation from Node's "strip" mode.

Sits next to the release / execArgv arms shipped in #1348 / #1349.

Test plan

  • test-parity/node-suite/process/features/features.ts asserts shape (typeof per field) rather than specific values, so the parity check survives any future Node version bumping individual flags.
  • Byte-identical to node --experimental-strip-types on the typeof assertions.
  • cargo fmt --all -- --check clean.

Node's `process.features` is an object of boolean capability flags
(`tls`, `ipv6`, `inspector`, `openssl_is_boringssl`, ...) — consumers
branch on individual fields to detect what the runtime links in.
Perry was returning a 0 sentinel, so reading any field came back
`undefined`.

Lowered in `expr_member.rs` (both bare `process.features` and the
`globalThis.process.features` paths) to an inline `Expr::Object`
literal built by a new `process_features_literal()` helper. Values
reflect what Perry's runtime actually supports — TLS/IPv6 true,
inspector/debug/boringssl/quic false, `typescript: "transform"` to
distinguish Perry's native TS compilation from Node's `"strip"` mode.

Test: test-parity/node-suite/process/features/features.ts asserts
*shape* (typeof per field) rather than specific values, so the parity
check survives any future Node version bumping individual flags.
@proggeramlug
proggeramlug merged commit a999db9 into main May 23, 2026
9 checks passed
@proggeramlug
proggeramlug deleted the fix/1378-process-features branch May 23, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:process — implement process.features

1 participant