diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d45b64de8..f1f8bd61b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -54,6 +54,7 @@ jobs: # this is a visibility job, not a gate. run: | cargo llvm-cov --workspace --no-fail-fast \ + --exclude perry-doc-fixture-my-bindings \ --exclude perry-ui-macos \ --exclude perry-ui-ios \ --exclude perry-ui-visionos \ @@ -64,6 +65,7 @@ jobs: --exclude perry-ui-windows \ --html --output-dir target/llvm-cov-html cargo llvm-cov report --no-fail-fast \ + --exclude perry-doc-fixture-my-bindings \ --exclude perry-ui-macos \ --exclude perry-ui-ios \ --exclude perry-ui-visionos \ @@ -74,6 +76,7 @@ jobs: --exclude perry-ui-windows \ --lcov --output-path target/lcov.info cargo llvm-cov report --no-fail-fast \ + --exclude perry-doc-fixture-my-bindings \ --exclude perry-ui-macos \ --exclude perry-ui-ios \ --exclude perry-ui-visionos \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7dafb59e8..3997f1635 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -189,18 +189,41 @@ jobs: RUST_TEST_THREADS=1 cargo test -p perry-runtime # The remaining workspace includes large `perry` / `perry-stdlib` # test binaries. Keep Cargo build jobs serialized so the runner - # does not link several of those large test binaries at once. + # does not link several of those large test binaries at once, then + # run packages one at a time and prune linked test executables so + # target/debug/deps does not exhaust the runner disk mid-job. export CARGO_BUILD_JOBS=1 - cargo test --workspace \ - --exclude perry-runtime \ - --exclude perry-ui-macos \ - --exclude perry-ui-ios \ - --exclude perry-ui-visionos \ - --exclude perry-ui-tvos \ - --exclude perry-ui-watchos \ - --exclude perry-ui-gtk4 \ - --exclude perry-ui-android \ - --exclude perry-ui-windows + workspace_packages="$( + cargo metadata --no-deps --format-version 1 | python3 -c ' + import json + import sys + + excluded = { + "perry-runtime", + "perry-ui-macos", + "perry-ui-ios", + "perry-ui-visionos", + "perry-ui-tvos", + "perry-ui-watchos", + "perry-ui-gtk4", + "perry-ui-android", + "perry-ui-windows", + "perry-doc-fixture-my-bindings", + } + metadata = json.load(sys.stdin) + workspace_members = set(metadata["workspace_members"]) + for package in metadata["packages"]: + if package["id"] in workspace_members and package["name"] not in excluded: + print(package["name"]) + ' + )" + + for package in $workspace_packages; do + echo "::group::cargo test -p $package" + cargo test -p "$package" + echo "::endgroup::" + find target/debug/deps -maxdepth 1 -type f -perm -111 ! -name '*.so' -delete + done # --------------------------------------------------------------------------- # Compiler-output regression gate diff --git a/crates/perry-api-manifest/src/entries.rs b/crates/perry-api-manifest/src/entries.rs index c7b234645..d271e5b62 100644 --- a/crates/perry-api-manifest/src/entries.rs +++ b/crates/perry-api-manifest/src/entries.rs @@ -71,6 +71,7 @@ pub const NATIVE_MODULES: &[&str] = &[ "path/posix", "path/win32", "console", + "constants", "util", "util/types", "url", @@ -2144,6 +2145,207 @@ pub static API_MANIFEST: &[ApiEntry] = &[ // get_native_module_constant in perry-runtime/src/object.rs. property("os", "constants"), property("crypto", "constants"), + // Deprecated `node:constants` flat alias. It mirrors the fs/os/crypto + // constants that Perry already exposes under module-specific + // `*.constants` namespaces. + property("constants", "F_OK"), + property("constants", "R_OK"), + property("constants", "W_OK"), + property("constants", "X_OK"), + property("constants", "O_RDONLY"), + property("constants", "O_WRONLY"), + property("constants", "O_RDWR"), + property("constants", "O_NOFOLLOW"), + property("constants", "O_CREAT"), + property("constants", "O_TRUNC"), + property("constants", "O_APPEND"), + property("constants", "O_EXCL"), + property("constants", "COPYFILE_EXCL"), + property("constants", "COPYFILE_FICLONE"), + property("constants", "COPYFILE_FICLONE_FORCE"), + property("constants", "S_IRUSR"), + property("constants", "S_IWUSR"), + property("constants", "S_IXUSR"), + property("constants", "S_IRGRP"), + property("constants", "S_IWGRP"), + property("constants", "S_IXGRP"), + property("constants", "S_IROTH"), + property("constants", "S_IWOTH"), + property("constants", "S_IXOTH"), + property("constants", "SIGHUP"), + property("constants", "SIGINT"), + property("constants", "SIGQUIT"), + property("constants", "SIGILL"), + property("constants", "SIGTRAP"), + property("constants", "SIGABRT"), + property("constants", "SIGIOT"), + property("constants", "SIGBUS"), + property("constants", "SIGFPE"), + property("constants", "SIGKILL"), + property("constants", "SIGUSR1"), + property("constants", "SIGSEGV"), + property("constants", "SIGUSR2"), + property("constants", "SIGPIPE"), + property("constants", "SIGALRM"), + property("constants", "SIGTERM"), + property("constants", "SIGCHLD"), + property("constants", "SIGCONT"), + property("constants", "SIGSTOP"), + property("constants", "SIGTSTP"), + property("constants", "SIGTTIN"), + property("constants", "SIGTTOU"), + property("constants", "SIGURG"), + property("constants", "SIGXCPU"), + property("constants", "SIGXFSZ"), + property("constants", "SIGVTALRM"), + property("constants", "SIGPROF"), + property("constants", "SIGWINCH"), + property("constants", "SIGIO"), + property("constants", "SIGSYS"), + property("constants", "E2BIG"), + property("constants", "EACCES"), + property("constants", "EADDRINUSE"), + property("constants", "EADDRNOTAVAIL"), + property("constants", "EAFNOSUPPORT"), + property("constants", "EAGAIN"), + property("constants", "EALREADY"), + property("constants", "EBADF"), + property("constants", "EBADMSG"), + property("constants", "EBUSY"), + property("constants", "ECANCELED"), + property("constants", "ECHILD"), + property("constants", "ECONNABORTED"), + property("constants", "ECONNREFUSED"), + property("constants", "ECONNRESET"), + property("constants", "EDEADLK"), + property("constants", "EDESTADDRREQ"), + property("constants", "EDOM"), + property("constants", "EDQUOT"), + property("constants", "EEXIST"), + property("constants", "EFAULT"), + property("constants", "EFBIG"), + property("constants", "EHOSTUNREACH"), + property("constants", "EIDRM"), + property("constants", "EILSEQ"), + property("constants", "EINPROGRESS"), + property("constants", "EINTR"), + property("constants", "EINVAL"), + property("constants", "EIO"), + property("constants", "EISCONN"), + property("constants", "EISDIR"), + property("constants", "ELOOP"), + property("constants", "EMFILE"), + property("constants", "EMLINK"), + property("constants", "EMSGSIZE"), + property("constants", "EMULTIHOP"), + property("constants", "ENAMETOOLONG"), + property("constants", "ENETDOWN"), + property("constants", "ENETRESET"), + property("constants", "ENETUNREACH"), + property("constants", "ENFILE"), + property("constants", "ENOBUFS"), + property("constants", "ENODATA"), + property("constants", "ENODEV"), + property("constants", "ENOENT"), + property("constants", "ENOEXEC"), + property("constants", "ENOLCK"), + property("constants", "ENOLINK"), + property("constants", "ENOMEM"), + property("constants", "ENOMSG"), + property("constants", "ENOPROTOOPT"), + property("constants", "ENOSPC"), + property("constants", "ENOSR"), + property("constants", "ENOSTR"), + property("constants", "ENOSYS"), + property("constants", "ENOTCONN"), + property("constants", "ENOTDIR"), + property("constants", "ENOTEMPTY"), + property("constants", "ENOTSOCK"), + property("constants", "ENOTSUP"), + property("constants", "ENOTTY"), + property("constants", "ENXIO"), + property("constants", "EOPNOTSUPP"), + property("constants", "EOVERFLOW"), + property("constants", "EPERM"), + property("constants", "EPIPE"), + property("constants", "EPROTO"), + property("constants", "EPROTONOSUPPORT"), + property("constants", "EPROTOTYPE"), + property("constants", "ERANGE"), + property("constants", "EROFS"), + property("constants", "ESPIPE"), + property("constants", "ESRCH"), + property("constants", "ESTALE"), + property("constants", "ETIME"), + property("constants", "ETIMEDOUT"), + property("constants", "ETXTBSY"), + property("constants", "EWOULDBLOCK"), + property("constants", "EXDEV"), + property("constants", "PRIORITY_LOW"), + property("constants", "PRIORITY_BELOW_NORMAL"), + property("constants", "PRIORITY_NORMAL"), + property("constants", "PRIORITY_ABOVE_NORMAL"), + property("constants", "PRIORITY_HIGH"), + property("constants", "PRIORITY_HIGHEST"), + property("constants", "RTLD_LAZY"), + property("constants", "RTLD_NOW"), + property("constants", "RTLD_GLOBAL"), + property("constants", "RTLD_LOCAL"), + property("constants", "RTLD_DEEPBIND"), + property("constants", "OPENSSL_VERSION_NUMBER"), + property("constants", "SSL_OP_ALL"), + property("constants", "SSL_OP_ALLOW_NO_DHE_KEX"), + property("constants", "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION"), + property("constants", "SSL_OP_CIPHER_SERVER_PREFERENCE"), + property("constants", "SSL_OP_CISCO_ANYCONNECT"), + property("constants", "SSL_OP_COOKIE_EXCHANGE"), + property("constants", "SSL_OP_CRYPTOPRO_TLSEXT_BUG"), + property("constants", "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS"), + property("constants", "SSL_OP_LEGACY_SERVER_CONNECT"), + property("constants", "SSL_OP_NO_COMPRESSION"), + property("constants", "SSL_OP_NO_ENCRYPT_THEN_MAC"), + property("constants", "SSL_OP_NO_QUERY_MTU"), + property("constants", "SSL_OP_NO_RENEGOTIATION"), + property("constants", "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION"), + property("constants", "SSL_OP_NO_SSLv2"), + property("constants", "SSL_OP_NO_SSLv3"), + property("constants", "SSL_OP_NO_TICKET"), + property("constants", "RSA_PKCS1_PADDING"), + property("constants", "SSL_OP_NO_TLSv1"), + property("constants", "SSL_OP_NO_TLSv1_1"), + property("constants", "SSL_OP_NO_TLSv1_2"), + property("constants", "SSL_OP_NO_TLSv1_3"), + property("constants", "SSL_OP_PRIORITIZE_CHACHA"), + property("constants", "SSL_OP_TLS_ROLLBACK_BUG"), + property("constants", "ENGINE_METHOD_RSA"), + property("constants", "ENGINE_METHOD_DSA"), + property("constants", "ENGINE_METHOD_DH"), + property("constants", "ENGINE_METHOD_RAND"), + property("constants", "ENGINE_METHOD_EC"), + property("constants", "ENGINE_METHOD_CIPHERS"), + property("constants", "ENGINE_METHOD_DIGESTS"), + property("constants", "ENGINE_METHOD_PKEY_METHS"), + property("constants", "ENGINE_METHOD_PKEY_ASN1_METHS"), + property("constants", "ENGINE_METHOD_ALL"), + property("constants", "ENGINE_METHOD_NONE"), + property("constants", "DH_CHECK_P_NOT_SAFE_PRIME"), + property("constants", "DH_CHECK_P_NOT_PRIME"), + property("constants", "DH_UNABLE_TO_CHECK_GENERATOR"), + property("constants", "DH_NOT_SUITABLE_GENERATOR"), + property("constants", "RSA_NO_PADDING"), + property("constants", "RSA_PKCS1_OAEP_PADDING"), + property("constants", "RSA_X931_PADDING"), + property("constants", "RSA_PKCS1_PSS_PADDING"), + property("constants", "RSA_PSS_SALTLEN_DIGEST"), + property("constants", "RSA_PSS_SALTLEN_MAX_SIGN"), + property("constants", "RSA_PSS_SALTLEN_AUTO"), + property("constants", "TLS1_VERSION"), + property("constants", "TLS1_1_VERSION"), + property("constants", "TLS1_2_VERSION"), + property("constants", "TLS1_3_VERSION"), + property("constants", "POINT_CONVERSION_COMPRESSED"), + property("constants", "POINT_CONVERSION_UNCOMPRESSED"), + property("constants", "POINT_CONVERSION_HYBRID"), // path — methods mapped to Expr::Path* in expr_call.rs. method("path", "join", false, None), method("path", "dirname", false, None), diff --git a/crates/perry-api-manifest/src/lib.rs b/crates/perry-api-manifest/src/lib.rs index a10f8a6b9..5112d3e2c 100644 --- a/crates/perry-api-manifest/src/lib.rs +++ b/crates/perry-api-manifest/src/lib.rs @@ -299,6 +299,27 @@ mod tests { assert!(matches!(entry.returns, TypeSpec::Bool)); } + #[test] + fn deprecated_constants_alias_has_manifest_entries() { + for name in [ + "F_OK", + "SIGTERM", + "SIGINT", + "EACCES", + "PRIORITY_NORMAL", + "RTLD_DEEPBIND", + "RSA_PKCS1_PADDING", + "SSL_OP_NO_SSLv2", + "SSL_OP_NO_TLSv1", + "POINT_CONVERSION_COMPRESSED", + "POINT_CONVERSION_UNCOMPRESSED", + ] { + let entry = module_has_symbol("node:constants", name) + .expect("node:constants representative property should be in the manifest"); + assert!(matches!(entry.kind, ApiKind::Property)); + } + } + #[test] fn known_modules_consistent_with_manifest() { // Every entry's module must appear in NATIVE_MODULES. diff --git a/crates/perry-codegen/src/ext_registry.rs b/crates/perry-codegen/src/ext_registry.rs index 845a1bcde..a66339fd2 100644 --- a/crates/perry-codegen/src/ext_registry.rs +++ b/crates/perry-codegen/src/ext_registry.rs @@ -317,13 +317,17 @@ pub fn take_used_providers() -> HashSet { mod tests { use super::*; + static PROVIDER_TEST_LOCK: Mutex<()> = Mutex::new(()); + // `USED_PROVIDERS` is a process-wide static; other tests in the same - // process may concurrently insert into it via `LlBlock::call`. We - // therefore check membership rather than exact set equality. The - // non-registered-FFI check uses a deliberately unique symbol name - // that no other test will ever insert. + // process may concurrently insert into it via `LlBlock::call`, and these + // module tests drain it. Serialize the explicit drain/record assertions so + // one test cannot steal another test's providers. #[test] fn registry_dispatch_routes_to_correct_owner() { + let _guard = PROVIDER_TEST_LOCK + .lock() + .expect("provider test lock poisoned"); // Drain anything left over from prior tests. let _ = take_used_providers(); @@ -380,6 +384,9 @@ mod tests { /// `Undefined symbols: _js_node_http_create_server_with_options`. #[test] fn emitted_create_server_symbol_routes_to_http() { + let _guard = PROVIDER_TEST_LOCK + .lock() + .expect("provider test lock poisoned"); let _ = take_used_providers(); record_ffi_call("js_node_http_create_server_with_options"); let got = take_used_providers(); diff --git a/crates/perry-runtime/src/object/native_module.rs b/crates/perry-runtime/src/object/native_module.rs index 8434edcba..e6c6973b4 100644 --- a/crates/perry-runtime/src/object/native_module.rs +++ b/crates/perry-runtime/src/object/native_module.rs @@ -123,6 +123,207 @@ fn normalize_native_module_alias(module_name: &str) -> &str { } } +const DEPRECATED_CONSTANTS_KEYS: &[&[u8]] = &[ + b"F_OK", + b"R_OK", + b"W_OK", + b"X_OK", + b"O_RDONLY", + b"O_WRONLY", + b"O_RDWR", + b"O_NOFOLLOW", + b"O_CREAT", + b"O_TRUNC", + b"O_APPEND", + b"O_EXCL", + b"COPYFILE_EXCL", + b"COPYFILE_FICLONE", + b"COPYFILE_FICLONE_FORCE", + b"S_IRUSR", + b"S_IWUSR", + b"S_IXUSR", + b"S_IRGRP", + b"S_IWGRP", + b"S_IXGRP", + b"S_IROTH", + b"S_IWOTH", + b"S_IXOTH", + b"SIGHUP", + b"SIGINT", + b"SIGQUIT", + b"SIGILL", + b"SIGTRAP", + b"SIGABRT", + b"SIGIOT", + b"SIGBUS", + b"SIGFPE", + b"SIGKILL", + b"SIGUSR1", + b"SIGSEGV", + b"SIGUSR2", + b"SIGPIPE", + b"SIGALRM", + b"SIGTERM", + b"SIGCHLD", + b"SIGCONT", + b"SIGSTOP", + b"SIGTSTP", + b"SIGTTIN", + b"SIGTTOU", + b"SIGURG", + b"SIGXCPU", + b"SIGXFSZ", + b"SIGVTALRM", + b"SIGPROF", + b"SIGWINCH", + b"SIGIO", + b"SIGSYS", + b"E2BIG", + b"EACCES", + b"EADDRINUSE", + b"EADDRNOTAVAIL", + b"EAFNOSUPPORT", + b"EAGAIN", + b"EALREADY", + b"EBADF", + b"EBADMSG", + b"EBUSY", + b"ECANCELED", + b"ECHILD", + b"ECONNABORTED", + b"ECONNREFUSED", + b"ECONNRESET", + b"EDEADLK", + b"EDESTADDRREQ", + b"EDOM", + b"EDQUOT", + b"EEXIST", + b"EFAULT", + b"EFBIG", + b"EHOSTUNREACH", + b"EIDRM", + b"EILSEQ", + b"EINPROGRESS", + b"EINTR", + b"EINVAL", + b"EIO", + b"EISCONN", + b"EISDIR", + b"ELOOP", + b"EMFILE", + b"EMLINK", + b"EMSGSIZE", + b"EMULTIHOP", + b"ENAMETOOLONG", + b"ENETDOWN", + b"ENETRESET", + b"ENETUNREACH", + b"ENFILE", + b"ENOBUFS", + b"ENODATA", + b"ENODEV", + b"ENOENT", + b"ENOEXEC", + b"ENOLCK", + b"ENOLINK", + b"ENOMEM", + b"ENOMSG", + b"ENOPROTOOPT", + b"ENOSPC", + b"ENOSR", + b"ENOSTR", + b"ENOSYS", + b"ENOTCONN", + b"ENOTDIR", + b"ENOTEMPTY", + b"ENOTSOCK", + b"ENOTSUP", + b"ENOTTY", + b"ENXIO", + b"EOPNOTSUPP", + b"EOVERFLOW", + b"EPERM", + b"EPIPE", + b"EPROTO", + b"EPROTONOSUPPORT", + b"EPROTOTYPE", + b"ERANGE", + b"EROFS", + b"ESPIPE", + b"ESRCH", + b"ESTALE", + b"ETIME", + b"ETIMEDOUT", + b"ETXTBSY", + b"EWOULDBLOCK", + b"EXDEV", + b"PRIORITY_LOW", + b"PRIORITY_BELOW_NORMAL", + b"PRIORITY_NORMAL", + b"PRIORITY_ABOVE_NORMAL", + b"PRIORITY_HIGH", + b"PRIORITY_HIGHEST", + b"RTLD_LAZY", + b"RTLD_NOW", + b"RTLD_GLOBAL", + b"RTLD_LOCAL", + b"RTLD_DEEPBIND", + b"OPENSSL_VERSION_NUMBER", + b"SSL_OP_ALL", + b"SSL_OP_ALLOW_NO_DHE_KEX", + b"SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION", + b"SSL_OP_CIPHER_SERVER_PREFERENCE", + b"SSL_OP_CISCO_ANYCONNECT", + b"SSL_OP_COOKIE_EXCHANGE", + b"SSL_OP_CRYPTOPRO_TLSEXT_BUG", + b"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS", + b"SSL_OP_LEGACY_SERVER_CONNECT", + b"SSL_OP_NO_COMPRESSION", + b"SSL_OP_NO_ENCRYPT_THEN_MAC", + b"SSL_OP_NO_QUERY_MTU", + b"SSL_OP_NO_RENEGOTIATION", + b"SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION", + b"SSL_OP_NO_SSLv2", + b"SSL_OP_NO_SSLv3", + b"SSL_OP_NO_TICKET", + b"SSL_OP_NO_TLSv1", + b"SSL_OP_NO_TLSv1_1", + b"SSL_OP_NO_TLSv1_2", + b"SSL_OP_NO_TLSv1_3", + b"SSL_OP_PRIORITIZE_CHACHA", + b"SSL_OP_TLS_ROLLBACK_BUG", + b"ENGINE_METHOD_RSA", + b"ENGINE_METHOD_DSA", + b"ENGINE_METHOD_DH", + b"ENGINE_METHOD_RAND", + b"ENGINE_METHOD_EC", + b"ENGINE_METHOD_CIPHERS", + b"ENGINE_METHOD_DIGESTS", + b"ENGINE_METHOD_PKEY_METHS", + b"ENGINE_METHOD_PKEY_ASN1_METHS", + b"ENGINE_METHOD_ALL", + b"ENGINE_METHOD_NONE", + b"DH_CHECK_P_NOT_SAFE_PRIME", + b"DH_CHECK_P_NOT_PRIME", + b"DH_UNABLE_TO_CHECK_GENERATOR", + b"DH_NOT_SUITABLE_GENERATOR", + b"RSA_PKCS1_PADDING", + b"RSA_NO_PADDING", + b"RSA_PKCS1_OAEP_PADDING", + b"RSA_X931_PADDING", + b"RSA_PKCS1_PSS_PADDING", + b"RSA_PSS_SALTLEN_DIGEST", + b"RSA_PSS_SALTLEN_MAX_SIGN", + b"RSA_PSS_SALTLEN_AUTO", + b"TLS1_VERSION", + b"TLS1_1_VERSION", + b"TLS1_2_VERSION", + b"TLS1_3_VERSION", + b"POINT_CONVERSION_COMPRESSED", + b"POINT_CONVERSION_UNCOMPRESSED", + b"POINT_CONVERSION_HYBRID", +]; + pub(crate) fn native_module_enumerable_keys(module_name: &str) -> Option<&'static [&'static [u8]]> { match module_name { "assert/strict" => Some(&[ @@ -148,6 +349,7 @@ pub(crate) fn native_module_enumerable_keys(module_name: &str) -> Option<&'stati b"strict", ]), "buffer.constants" => Some(&[b"MAX_LENGTH", b"MAX_STRING_LENGTH"]), + "constants" => Some(DEPRECATED_CONSTANTS_KEYS), "querystring" => Some(&[ b"unescapeBuffer", b"unescape", @@ -200,7 +402,7 @@ pub(crate) fn native_module_enumerable_keys(module_name: &str) -> Option<&'stati fn should_cache_native_module_namespace(module_name: &str) -> bool { matches!( module_name, - "assert/strict" | "util" | "util.types" | "path.posix" | "path.win32" + "assert/strict" | "constants" | "util" | "util.types" | "path.posix" | "path.win32" ) } @@ -2056,6 +2258,12 @@ pub(crate) unsafe fn get_native_module_constant( "NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE" => Some(64.0), _ => None, }, + "constants" => fs_const(property) + .or_else(|| os_signal_const(property)) + .or_else(|| os_errno_const(property)) + .or_else(|| os_priority_const(property)) + .or_else(|| os_dlopen_const(property)) + .or_else(|| crypto_const(property)), "path" => match property { "sep" => { if cfg!(windows) { diff --git a/crates/perry-runtime/src/process.rs b/crates/perry-runtime/src/process.rs index 86ba75f8b..50627ffaf 100644 --- a/crates/perry-runtime/src/process.rs +++ b/crates/perry-runtime/src/process.rs @@ -64,9 +64,9 @@ pub extern "C" fn js_process_abort() { fn supported_builtin_module_name(name: &str) -> Option<&str> { match name { "assert" | "assert/strict" | "async_hooks" | "buffer" | "child_process" | "cluster" - | "console" | "crypto" | "events" | "fs" | "http" | "http2" | "https" | "net" | "os" - | "path" | "perf_hooks" | "process" | "punycode" | "querystring" | "readline" - | "stream" | "stream/promises" | "string_decoder" | "sys" | "timers" + | "console" | "constants" | "crypto" | "events" | "fs" | "http" | "http2" | "https" + | "net" | "os" | "path" | "perf_hooks" | "process" | "punycode" | "querystring" + | "readline" | "stream" | "stream/promises" | "string_decoder" | "sys" | "timers" | "timers/promises" | "tty" | "url" | "util" | "util/types" | "worker_threads" | "zlib" => { Some(name) } diff --git a/docs/api/perry.d.ts b/docs/api/perry.d.ts index 153d10144..bfe07ec3f 100644 --- a/docs/api/perry.d.ts +++ b/docs/api/perry.d.ts @@ -1,6 +1,6 @@ // Auto-generated from Perry's API manifest (#465). Do not edit by hand. // Source: perry-api-manifest::API_MANIFEST -// Coverage: 1580 entries across 87 modules +// Coverage: 1778 entries across 88 modules type PerryU32 = number & { readonly __perryU32?: never }; type PerryU64 = number & { readonly __perryU64?: never }; @@ -385,6 +385,405 @@ declare module "console" { export function warn(...args: any[]): any; } +declare module "constants" { + /** stdlib */ + export const COPYFILE_EXCL: any; + /** stdlib */ + export const COPYFILE_FICLONE: any; + /** stdlib */ + export const COPYFILE_FICLONE_FORCE: any; + /** stdlib */ + export const DH_CHECK_P_NOT_PRIME: any; + /** stdlib */ + export const DH_CHECK_P_NOT_SAFE_PRIME: any; + /** stdlib */ + export const DH_NOT_SUITABLE_GENERATOR: any; + /** stdlib */ + export const DH_UNABLE_TO_CHECK_GENERATOR: any; + /** stdlib */ + export const E2BIG: any; + /** stdlib */ + export const EACCES: any; + /** stdlib */ + export const EADDRINUSE: any; + /** stdlib */ + export const EADDRNOTAVAIL: any; + /** stdlib */ + export const EAFNOSUPPORT: any; + /** stdlib */ + export const EAGAIN: any; + /** stdlib */ + export const EALREADY: any; + /** stdlib */ + export const EBADF: any; + /** stdlib */ + export const EBADMSG: any; + /** stdlib */ + export const EBUSY: any; + /** stdlib */ + export const ECANCELED: any; + /** stdlib */ + export const ECHILD: any; + /** stdlib */ + export const ECONNABORTED: any; + /** stdlib */ + export const ECONNREFUSED: any; + /** stdlib */ + export const ECONNRESET: any; + /** stdlib */ + export const EDEADLK: any; + /** stdlib */ + export const EDESTADDRREQ: any; + /** stdlib */ + export const EDOM: any; + /** stdlib */ + export const EDQUOT: any; + /** stdlib */ + export const EEXIST: any; + /** stdlib */ + export const EFAULT: any; + /** stdlib */ + export const EFBIG: any; + /** stdlib */ + export const EHOSTUNREACH: any; + /** stdlib */ + export const EIDRM: any; + /** stdlib */ + export const EILSEQ: any; + /** stdlib */ + export const EINPROGRESS: any; + /** stdlib */ + export const EINTR: any; + /** stdlib */ + export const EINVAL: any; + /** stdlib */ + export const EIO: any; + /** stdlib */ + export const EISCONN: any; + /** stdlib */ + export const EISDIR: any; + /** stdlib */ + export const ELOOP: any; + /** stdlib */ + export const EMFILE: any; + /** stdlib */ + export const EMLINK: any; + /** stdlib */ + export const EMSGSIZE: any; + /** stdlib */ + export const EMULTIHOP: any; + /** stdlib */ + export const ENAMETOOLONG: any; + /** stdlib */ + export const ENETDOWN: any; + /** stdlib */ + export const ENETRESET: any; + /** stdlib */ + export const ENETUNREACH: any; + /** stdlib */ + export const ENFILE: any; + /** stdlib */ + export const ENGINE_METHOD_ALL: any; + /** stdlib */ + export const ENGINE_METHOD_CIPHERS: any; + /** stdlib */ + export const ENGINE_METHOD_DH: any; + /** stdlib */ + export const ENGINE_METHOD_DIGESTS: any; + /** stdlib */ + export const ENGINE_METHOD_DSA: any; + /** stdlib */ + export const ENGINE_METHOD_EC: any; + /** stdlib */ + export const ENGINE_METHOD_NONE: any; + /** stdlib */ + export const ENGINE_METHOD_PKEY_ASN1_METHS: any; + /** stdlib */ + export const ENGINE_METHOD_PKEY_METHS: any; + /** stdlib */ + export const ENGINE_METHOD_RAND: any; + /** stdlib */ + export const ENGINE_METHOD_RSA: any; + /** stdlib */ + export const ENOBUFS: any; + /** stdlib */ + export const ENODATA: any; + /** stdlib */ + export const ENODEV: any; + /** stdlib */ + export const ENOENT: any; + /** stdlib */ + export const ENOEXEC: any; + /** stdlib */ + export const ENOLCK: any; + /** stdlib */ + export const ENOLINK: any; + /** stdlib */ + export const ENOMEM: any; + /** stdlib */ + export const ENOMSG: any; + /** stdlib */ + export const ENOPROTOOPT: any; + /** stdlib */ + export const ENOSPC: any; + /** stdlib */ + export const ENOSR: any; + /** stdlib */ + export const ENOSTR: any; + /** stdlib */ + export const ENOSYS: any; + /** stdlib */ + export const ENOTCONN: any; + /** stdlib */ + export const ENOTDIR: any; + /** stdlib */ + export const ENOTEMPTY: any; + /** stdlib */ + export const ENOTSOCK: any; + /** stdlib */ + export const ENOTSUP: any; + /** stdlib */ + export const ENOTTY: any; + /** stdlib */ + export const ENXIO: any; + /** stdlib */ + export const EOPNOTSUPP: any; + /** stdlib */ + export const EOVERFLOW: any; + /** stdlib */ + export const EPERM: any; + /** stdlib */ + export const EPIPE: any; + /** stdlib */ + export const EPROTO: any; + /** stdlib */ + export const EPROTONOSUPPORT: any; + /** stdlib */ + export const EPROTOTYPE: any; + /** stdlib */ + export const ERANGE: any; + /** stdlib */ + export const EROFS: any; + /** stdlib */ + export const ESPIPE: any; + /** stdlib */ + export const ESRCH: any; + /** stdlib */ + export const ESTALE: any; + /** stdlib */ + export const ETIME: any; + /** stdlib */ + export const ETIMEDOUT: any; + /** stdlib */ + export const ETXTBSY: any; + /** stdlib */ + export const EWOULDBLOCK: any; + /** stdlib */ + export const EXDEV: any; + /** stdlib */ + export const F_OK: any; + /** stdlib */ + export const OPENSSL_VERSION_NUMBER: any; + /** stdlib */ + export const O_APPEND: any; + /** stdlib */ + export const O_CREAT: any; + /** stdlib */ + export const O_EXCL: any; + /** stdlib */ + export const O_NOFOLLOW: any; + /** stdlib */ + export const O_RDONLY: any; + /** stdlib */ + export const O_RDWR: any; + /** stdlib */ + export const O_TRUNC: any; + /** stdlib */ + export const O_WRONLY: any; + /** stdlib */ + export const POINT_CONVERSION_COMPRESSED: any; + /** stdlib */ + export const POINT_CONVERSION_HYBRID: any; + /** stdlib */ + export const POINT_CONVERSION_UNCOMPRESSED: any; + /** stdlib */ + export const PRIORITY_ABOVE_NORMAL: any; + /** stdlib */ + export const PRIORITY_BELOW_NORMAL: any; + /** stdlib */ + export const PRIORITY_HIGH: any; + /** stdlib */ + export const PRIORITY_HIGHEST: any; + /** stdlib */ + export const PRIORITY_LOW: any; + /** stdlib */ + export const PRIORITY_NORMAL: any; + /** stdlib */ + export const RSA_NO_PADDING: any; + /** stdlib */ + export const RSA_PKCS1_OAEP_PADDING: any; + /** stdlib */ + export const RSA_PKCS1_PADDING: any; + /** stdlib */ + export const RSA_PKCS1_PSS_PADDING: any; + /** stdlib */ + export const RSA_PSS_SALTLEN_AUTO: any; + /** stdlib */ + export const RSA_PSS_SALTLEN_DIGEST: any; + /** stdlib */ + export const RSA_PSS_SALTLEN_MAX_SIGN: any; + /** stdlib */ + export const RSA_X931_PADDING: any; + /** stdlib */ + export const RTLD_DEEPBIND: any; + /** stdlib */ + export const RTLD_GLOBAL: any; + /** stdlib */ + export const RTLD_LAZY: any; + /** stdlib */ + export const RTLD_LOCAL: any; + /** stdlib */ + export const RTLD_NOW: any; + /** stdlib */ + export const R_OK: any; + /** stdlib */ + export const SIGABRT: any; + /** stdlib */ + export const SIGALRM: any; + /** stdlib */ + export const SIGBUS: any; + /** stdlib */ + export const SIGCHLD: any; + /** stdlib */ + export const SIGCONT: any; + /** stdlib */ + export const SIGFPE: any; + /** stdlib */ + export const SIGHUP: any; + /** stdlib */ + export const SIGILL: any; + /** stdlib */ + export const SIGINT: any; + /** stdlib */ + export const SIGIO: any; + /** stdlib */ + export const SIGIOT: any; + /** stdlib */ + export const SIGKILL: any; + /** stdlib */ + export const SIGPIPE: any; + /** stdlib */ + export const SIGPROF: any; + /** stdlib */ + export const SIGQUIT: any; + /** stdlib */ + export const SIGSEGV: any; + /** stdlib */ + export const SIGSTOP: any; + /** stdlib */ + export const SIGSYS: any; + /** stdlib */ + export const SIGTERM: any; + /** stdlib */ + export const SIGTRAP: any; + /** stdlib */ + export const SIGTSTP: any; + /** stdlib */ + export const SIGTTIN: any; + /** stdlib */ + export const SIGTTOU: any; + /** stdlib */ + export const SIGURG: any; + /** stdlib */ + export const SIGUSR1: any; + /** stdlib */ + export const SIGUSR2: any; + /** stdlib */ + export const SIGVTALRM: any; + /** stdlib */ + export const SIGWINCH: any; + /** stdlib */ + export const SIGXCPU: any; + /** stdlib */ + export const SIGXFSZ: any; + /** stdlib */ + export const SSL_OP_ALL: any; + /** stdlib */ + export const SSL_OP_ALLOW_NO_DHE_KEX: any; + /** stdlib */ + export const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: any; + /** stdlib */ + export const SSL_OP_CIPHER_SERVER_PREFERENCE: any; + /** stdlib */ + export const SSL_OP_CISCO_ANYCONNECT: any; + /** stdlib */ + export const SSL_OP_COOKIE_EXCHANGE: any; + /** stdlib */ + export const SSL_OP_CRYPTOPRO_TLSEXT_BUG: any; + /** stdlib */ + export const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: any; + /** stdlib */ + export const SSL_OP_LEGACY_SERVER_CONNECT: any; + /** stdlib */ + export const SSL_OP_NO_COMPRESSION: any; + /** stdlib */ + export const SSL_OP_NO_ENCRYPT_THEN_MAC: any; + /** stdlib */ + export const SSL_OP_NO_QUERY_MTU: any; + /** stdlib */ + export const SSL_OP_NO_RENEGOTIATION: any; + /** stdlib */ + export const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: any; + /** stdlib */ + export const SSL_OP_NO_SSLv2: any; + /** stdlib */ + export const SSL_OP_NO_SSLv3: any; + /** stdlib */ + export const SSL_OP_NO_TICKET: any; + /** stdlib */ + export const SSL_OP_NO_TLSv1: any; + /** stdlib */ + export const SSL_OP_NO_TLSv1_1: any; + /** stdlib */ + export const SSL_OP_NO_TLSv1_2: any; + /** stdlib */ + export const SSL_OP_NO_TLSv1_3: any; + /** stdlib */ + export const SSL_OP_PRIORITIZE_CHACHA: any; + /** stdlib */ + export const SSL_OP_TLS_ROLLBACK_BUG: any; + /** stdlib */ + export const S_IRGRP: any; + /** stdlib */ + export const S_IROTH: any; + /** stdlib */ + export const S_IRUSR: any; + /** stdlib */ + export const S_IWGRP: any; + /** stdlib */ + export const S_IWOTH: any; + /** stdlib */ + export const S_IWUSR: any; + /** stdlib */ + export const S_IXGRP: any; + /** stdlib */ + export const S_IXOTH: any; + /** stdlib */ + export const S_IXUSR: any; + /** stdlib */ + export const TLS1_1_VERSION: any; + /** stdlib */ + export const TLS1_2_VERSION: any; + /** stdlib */ + export const TLS1_3_VERSION: any; + /** stdlib */ + export const TLS1_VERSION: any; + /** stdlib */ + export const W_OK: any; + /** stdlib */ + export const X_OK: any; +} + declare module "cron" { /** stdlib */ export function describe(expr: string): string; diff --git a/docs/src/api/reference.md b/docs/src/api/reference.md index 366efdff8..5da2f9add 100644 --- a/docs/src/api/reference.md +++ b/docs/src/api/reference.md @@ -2,7 +2,7 @@ This page is auto-generated from Perry's compile-time API manifest (`perry-api-manifest::API_MANIFEST`). It is the source of truth for what `perry compile` accepts; references to symbols not listed here produce `R005 UnimplementedApi` (issue #463). Stubs (#464) are flagged ⚠ — they link cleanly but no-op at runtime on the chosen target. -Total: 1580 entries across 87 modules. +Total: 1778 entries across 88 modules. ## Modules @@ -21,6 +21,7 @@ Total: 1580 entries across 87 modules. - [`cluster`](#cluster) - [`commander`](#commander) - [`console`](#console) +- [`constants`](#constants) - [`cron`](#cron) - [`crypto`](#crypto) - [`date-fns`](#date-fns) @@ -394,6 +395,209 @@ Total: 1580 entries across 87 modules. - `trace` — module - `warn` — module +## `constants` + +### Properties + +- `COPYFILE_EXCL` +- `COPYFILE_FICLONE` +- `COPYFILE_FICLONE_FORCE` +- `DH_CHECK_P_NOT_PRIME` +- `DH_CHECK_P_NOT_SAFE_PRIME` +- `DH_NOT_SUITABLE_GENERATOR` +- `DH_UNABLE_TO_CHECK_GENERATOR` +- `E2BIG` +- `EACCES` +- `EADDRINUSE` +- `EADDRNOTAVAIL` +- `EAFNOSUPPORT` +- `EAGAIN` +- `EALREADY` +- `EBADF` +- `EBADMSG` +- `EBUSY` +- `ECANCELED` +- `ECHILD` +- `ECONNABORTED` +- `ECONNREFUSED` +- `ECONNRESET` +- `EDEADLK` +- `EDESTADDRREQ` +- `EDOM` +- `EDQUOT` +- `EEXIST` +- `EFAULT` +- `EFBIG` +- `EHOSTUNREACH` +- `EIDRM` +- `EILSEQ` +- `EINPROGRESS` +- `EINTR` +- `EINVAL` +- `EIO` +- `EISCONN` +- `EISDIR` +- `ELOOP` +- `EMFILE` +- `EMLINK` +- `EMSGSIZE` +- `EMULTIHOP` +- `ENAMETOOLONG` +- `ENETDOWN` +- `ENETRESET` +- `ENETUNREACH` +- `ENFILE` +- `ENGINE_METHOD_ALL` +- `ENGINE_METHOD_CIPHERS` +- `ENGINE_METHOD_DH` +- `ENGINE_METHOD_DIGESTS` +- `ENGINE_METHOD_DSA` +- `ENGINE_METHOD_EC` +- `ENGINE_METHOD_NONE` +- `ENGINE_METHOD_PKEY_ASN1_METHS` +- `ENGINE_METHOD_PKEY_METHS` +- `ENGINE_METHOD_RAND` +- `ENGINE_METHOD_RSA` +- `ENOBUFS` +- `ENODATA` +- `ENODEV` +- `ENOENT` +- `ENOEXEC` +- `ENOLCK` +- `ENOLINK` +- `ENOMEM` +- `ENOMSG` +- `ENOPROTOOPT` +- `ENOSPC` +- `ENOSR` +- `ENOSTR` +- `ENOSYS` +- `ENOTCONN` +- `ENOTDIR` +- `ENOTEMPTY` +- `ENOTSOCK` +- `ENOTSUP` +- `ENOTTY` +- `ENXIO` +- `EOPNOTSUPP` +- `EOVERFLOW` +- `EPERM` +- `EPIPE` +- `EPROTO` +- `EPROTONOSUPPORT` +- `EPROTOTYPE` +- `ERANGE` +- `EROFS` +- `ESPIPE` +- `ESRCH` +- `ESTALE` +- `ETIME` +- `ETIMEDOUT` +- `ETXTBSY` +- `EWOULDBLOCK` +- `EXDEV` +- `F_OK` +- `OPENSSL_VERSION_NUMBER` +- `O_APPEND` +- `O_CREAT` +- `O_EXCL` +- `O_NOFOLLOW` +- `O_RDONLY` +- `O_RDWR` +- `O_TRUNC` +- `O_WRONLY` +- `POINT_CONVERSION_COMPRESSED` +- `POINT_CONVERSION_HYBRID` +- `POINT_CONVERSION_UNCOMPRESSED` +- `PRIORITY_ABOVE_NORMAL` +- `PRIORITY_BELOW_NORMAL` +- `PRIORITY_HIGH` +- `PRIORITY_HIGHEST` +- `PRIORITY_LOW` +- `PRIORITY_NORMAL` +- `RSA_NO_PADDING` +- `RSA_PKCS1_OAEP_PADDING` +- `RSA_PKCS1_PADDING` +- `RSA_PKCS1_PSS_PADDING` +- `RSA_PSS_SALTLEN_AUTO` +- `RSA_PSS_SALTLEN_DIGEST` +- `RSA_PSS_SALTLEN_MAX_SIGN` +- `RSA_X931_PADDING` +- `RTLD_DEEPBIND` +- `RTLD_GLOBAL` +- `RTLD_LAZY` +- `RTLD_LOCAL` +- `RTLD_NOW` +- `R_OK` +- `SIGABRT` +- `SIGALRM` +- `SIGBUS` +- `SIGCHLD` +- `SIGCONT` +- `SIGFPE` +- `SIGHUP` +- `SIGILL` +- `SIGINT` +- `SIGIO` +- `SIGIOT` +- `SIGKILL` +- `SIGPIPE` +- `SIGPROF` +- `SIGQUIT` +- `SIGSEGV` +- `SIGSTOP` +- `SIGSYS` +- `SIGTERM` +- `SIGTRAP` +- `SIGTSTP` +- `SIGTTIN` +- `SIGTTOU` +- `SIGURG` +- `SIGUSR1` +- `SIGUSR2` +- `SIGVTALRM` +- `SIGWINCH` +- `SIGXCPU` +- `SIGXFSZ` +- `SSL_OP_ALL` +- `SSL_OP_ALLOW_NO_DHE_KEX` +- `SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION` +- `SSL_OP_CIPHER_SERVER_PREFERENCE` +- `SSL_OP_CISCO_ANYCONNECT` +- `SSL_OP_COOKIE_EXCHANGE` +- `SSL_OP_CRYPTOPRO_TLSEXT_BUG` +- `SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS` +- `SSL_OP_LEGACY_SERVER_CONNECT` +- `SSL_OP_NO_COMPRESSION` +- `SSL_OP_NO_ENCRYPT_THEN_MAC` +- `SSL_OP_NO_QUERY_MTU` +- `SSL_OP_NO_RENEGOTIATION` +- `SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION` +- `SSL_OP_NO_SSLv2` +- `SSL_OP_NO_SSLv3` +- `SSL_OP_NO_TICKET` +- `SSL_OP_NO_TLSv1` +- `SSL_OP_NO_TLSv1_1` +- `SSL_OP_NO_TLSv1_2` +- `SSL_OP_NO_TLSv1_3` +- `SSL_OP_PRIORITIZE_CHACHA` +- `SSL_OP_TLS_ROLLBACK_BUG` +- `S_IRGRP` +- `S_IROTH` +- `S_IRUSR` +- `S_IWGRP` +- `S_IWOTH` +- `S_IWUSR` +- `S_IXGRP` +- `S_IXOTH` +- `S_IXUSR` +- `TLS1_1_VERSION` +- `TLS1_2_VERSION` +- `TLS1_3_VERSION` +- `TLS1_VERSION` +- `W_OK` +- `X_OK` + ## `cron` ### Methods diff --git a/test-parity/node-suite/constants/imports/flat-alias.ts b/test-parity/node-suite/constants/imports/flat-alias.ts new file mode 100644 index 000000000..fec51cebe --- /dev/null +++ b/test-parity/node-suite/constants/imports/flat-alias.ts @@ -0,0 +1,69 @@ +import constantsDefault, * as constantsNs from "node:constants"; +import { + EACCES, + F_OK, + O_RDONLY, + POINT_CONVERSION_COMPRESSED, + POINT_CONVERSION_UNCOMPRESSED, + PRIORITY_NORMAL, + RSA_PKCS1_PADDING, + SIGINT, + SIGTERM, + RTLD_DEEPBIND, + SSL_OP_NO_SSLv2, + SSL_OP_NO_TLSv1, +} from "node:constants"; +import crypto from "node:crypto"; +import fs from "node:fs"; +import os from "node:os"; +import process from "node:process"; + +console.log("key count broad:", Object.keys(constantsDefault).length > 100); +console.log("F_OK:", F_OK, typeof F_OK); +console.log("O_RDONLY:", O_RDONLY, typeof O_RDONLY); +console.log("SIGINT:", SIGINT, typeof SIGINT); +console.log("SIGTERM:", SIGTERM, typeof SIGTERM); +console.log("EACCES:", EACCES, typeof EACCES); +console.log("PRIORITY_NORMAL:", PRIORITY_NORMAL, typeof PRIORITY_NORMAL); +console.log("RTLD_DEEPBIND:", RTLD_DEEPBIND, typeof RTLD_DEEPBIND); +console.log("RSA:", RSA_PKCS1_PADDING, typeof RSA_PKCS1_PADDING); +console.log("SSL_OP_NO_SSLv2:", SSL_OP_NO_SSLv2, typeof SSL_OP_NO_SSLv2); +console.log("SSL_OP_NO_TLSv1:", SSL_OP_NO_TLSv1, typeof SSL_OP_NO_TLSv1); +console.log( + "POINT_COMPRESSED:", + POINT_CONVERSION_COMPRESSED, + typeof POINT_CONVERSION_COMPRESSED, +); +console.log( + "POINT_UNCOMPRESSED:", + POINT_CONVERSION_UNCOMPRESSED, + typeof POINT_CONVERSION_UNCOMPRESSED, +); +console.log("default F_OK same fs:", constantsDefault.F_OK === fs.constants.F_OK); +console.log("ns F_OK same fs:", constantsNs.F_OK === fs.constants.F_OK); +console.log("SIGINT same os:", constantsDefault.SIGINT === os.constants.signals.SIGINT); +console.log("SIGTERM same os:", constantsDefault.SIGTERM === os.constants.signals.SIGTERM); +console.log("EACCES same os:", constantsDefault.EACCES === os.constants.errno.EACCES); +console.log( + "PRIORITY same os:", + constantsDefault.PRIORITY_NORMAL === os.constants.priority.PRIORITY_NORMAL, +); +console.log("RTLD same os:", constantsDefault.RTLD_DEEPBIND === os.constants.dlopen.RTLD_DEEPBIND); +console.log( + "RSA same crypto:", + constantsDefault.RSA_PKCS1_PADDING === crypto.constants.RSA_PKCS1_PADDING, +); +console.log( + "SSL_OP_NO_SSLv2 same crypto:", + constantsDefault.SSL_OP_NO_SSLv2 === crypto.constants.SSL_OP_NO_SSLv2, +); +console.log( + "POINT_UNCOMPRESSED same crypto:", + constantsDefault.POINT_CONVERSION_UNCOMPRESSED === + crypto.constants.POINT_CONVERSION_UNCOMPRESSED, +); +console.log("builtin module type:", typeof process.getBuiltinModule("constants")); +console.log( + "builtin module same default:", + process.getBuiltinModule("constants") === constantsDefault, +);