mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: fix status when compiled without inspector
PR-URL: https://github.com/nodejs/node/pull/60289 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
3437e1c4bd
commit
f25cce2805
|
|
@ -54,6 +54,7 @@ const noop = () => {};
|
||||||
const hasCrypto = Boolean(process.versions.openssl) &&
|
const hasCrypto = Boolean(process.versions.openssl) &&
|
||||||
!process.env.NODE_SKIP_CRYPTO;
|
!process.env.NODE_SKIP_CRYPTO;
|
||||||
|
|
||||||
|
const hasInspector = Boolean(process.features.inspector);
|
||||||
const hasSQLite = Boolean(process.versions.sqlite);
|
const hasSQLite = Boolean(process.versions.sqlite);
|
||||||
|
|
||||||
const hasQuic = hasCrypto && !!process.features.quic;
|
const hasQuic = hasCrypto && !!process.features.quic;
|
||||||
|
|
@ -711,7 +712,7 @@ function expectsError(validator, exact) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function skipIfInspectorDisabled() {
|
function skipIfInspectorDisabled() {
|
||||||
if (!process.features.inspector) {
|
if (!hasInspector) {
|
||||||
skip('V8 inspector is disabled');
|
skip('V8 inspector is disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -930,6 +931,7 @@ const common = {
|
||||||
hasIntl,
|
hasIntl,
|
||||||
hasCrypto,
|
hasCrypto,
|
||||||
hasQuic,
|
hasQuic,
|
||||||
|
hasInspector,
|
||||||
hasSQLite,
|
hasSQLite,
|
||||||
invalidArgTypeHelper,
|
invalidArgTypeHelper,
|
||||||
isAlive,
|
isAlive,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ const {
|
||||||
getTTYfd,
|
getTTYfd,
|
||||||
hasCrypto,
|
hasCrypto,
|
||||||
hasQuic,
|
hasQuic,
|
||||||
|
hasInspector,
|
||||||
hasSQLite,
|
hasSQLite,
|
||||||
hasIntl,
|
hasIntl,
|
||||||
hasIPv6,
|
hasIPv6,
|
||||||
|
|
@ -68,6 +69,7 @@ export {
|
||||||
getTTYfd,
|
getTTYfd,
|
||||||
hasCrypto,
|
hasCrypto,
|
||||||
hasQuic,
|
hasQuic,
|
||||||
|
hasInspector,
|
||||||
hasSQLite,
|
hasSQLite,
|
||||||
hasIntl,
|
hasIntl,
|
||||||
hasIPv6,
|
hasIPv6,
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,9 @@ class BuildRequirement {
|
||||||
// Not using common.hasCrypto because of the global leak checks
|
// Not using common.hasCrypto because of the global leak checks
|
||||||
this.hasCrypto = Boolean(process.versions.openssl) &&
|
this.hasCrypto = Boolean(process.versions.openssl) &&
|
||||||
!process.env.NODE_SKIP_CRYPTO;
|
!process.env.NODE_SKIP_CRYPTO;
|
||||||
|
|
||||||
|
// Not using common.hasInspector because of the global leak checks
|
||||||
|
this.hasInspector = Boolean(process.features.inspector);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -429,6 +432,9 @@ class BuildRequirement {
|
||||||
if (requires.has('crypto') && !this.hasCrypto) {
|
if (requires.has('crypto') && !this.hasCrypto) {
|
||||||
return 'crypto';
|
return 'crypto';
|
||||||
}
|
}
|
||||||
|
if (requires.has('inspector') && !this.hasInspector) {
|
||||||
|
return 'inspector';
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { hasCrypto, hasIntl, hasSQLite } from '../common/index.mjs';
|
import { hasCrypto, hasIntl, hasInspector, hasSQLite } from '../common/index.mjs';
|
||||||
import assert from 'node:assert';
|
import assert from 'node:assert';
|
||||||
import { builtinModules } from 'node:module';
|
import { builtinModules } from 'node:module';
|
||||||
import { isMainThread } from 'node:worker_threads';
|
import { isMainThread } from 'node:worker_threads';
|
||||||
|
|
@ -39,6 +39,10 @@ if (!hasIntl) {
|
||||||
// TODO(@jasnell): Remove this once node:quic graduates from unflagged.
|
// TODO(@jasnell): Remove this once node:quic graduates from unflagged.
|
||||||
publicBuiltins.delete('node:quic');
|
publicBuiltins.delete('node:quic');
|
||||||
|
|
||||||
|
if (!hasInspector) {
|
||||||
|
publicBuiltins.delete('inspector');
|
||||||
|
publicBuiltins.delete('inspector/promises');
|
||||||
|
}
|
||||||
if (!hasSQLite) {
|
if (!hasSQLite) {
|
||||||
publicBuiltins.delete('node:sqlite');
|
publicBuiltins.delete('node:sqlite');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"idlharness.any.js": {
|
"idlharness.any.js": {
|
||||||
"note": "https://github.com/nodejs/node/issues/44185",
|
"note": "https://github.com/nodejs/node/issues/44185",
|
||||||
"requires": ["crypto", "small-icu"]
|
"requires": ["crypto", "inspector", "small-icu"]
|
||||||
},
|
},
|
||||||
"idlharness-shadowrealm.window.js": {
|
"idlharness-shadowrealm.window.js": {
|
||||||
"skip": "ShadowRealm support is not enabled"
|
"skip": "ShadowRealm support is not enabled"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user