Skip to content

Commit 26f38e5

Browse files
committed
fix(constants): remove buggy getNodeDebugFlags function
- Removed getNodeDebugFlags() which incorrectly returned debug flags without values - Removed test coverage for non-existent function
1 parent 19d2db8 commit 26f38e5

2 files changed

Lines changed: 0 additions & 40 deletions

File tree

src/constants/node.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,6 @@ export function supportsProcessSend(): boolean {
121121
}
122122

123123
// Node.js flags.
124-
let _nodeDebugFlags: string[]
125-
export function getNodeDebugFlags(): string[] {
126-
if (_nodeDebugFlags === undefined) {
127-
_nodeDebugFlags = [
128-
'--inspect',
129-
'--inspect-brk',
130-
'--inspect-port',
131-
'--inspect-publish-uid',
132-
]
133-
}
134-
return _nodeDebugFlags
135-
}
136-
137124
let _nodeHardenFlags: string[]
138125
export function getNodeHardenFlags(): string[] {
139126
if (_nodeHardenFlags === undefined) {

test/constants/node.test.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
NODE_SEA_FUSE,
88
getExecPath,
99
getMaintainedNodeVersions,
10-
getNodeDebugFlags,
1110
getNodeDisableSigusr1Flags,
1211
getNodeHardenFlags,
1312
getNodeMajorVersion,
@@ -245,28 +244,6 @@ describe('node constants', () => {
245244
})
246245
})
247246

248-
describe('getNodeDebugFlags', () => {
249-
it('should return array of debug flags', () => {
250-
const flags = getNodeDebugFlags()
251-
expect(Array.isArray(flags)).toBe(true)
252-
expect(flags.length).toBeGreaterThan(0)
253-
})
254-
255-
it('should include inspect flags', () => {
256-
const flags = getNodeDebugFlags()
257-
expect(flags).toContain('--inspect')
258-
expect(flags).toContain('--inspect-brk')
259-
expect(flags).toContain('--inspect-port')
260-
expect(flags).toContain('--inspect-publish-uid')
261-
})
262-
263-
it('should return same instance on multiple calls', () => {
264-
const first = getNodeDebugFlags()
265-
const second = getNodeDebugFlags()
266-
expect(first).toBe(second)
267-
})
268-
})
269-
270247
describe('getNodeHardenFlags', () => {
271248
it('should return array of hardening flags', () => {
272249
const flags = getNodeHardenFlags()
@@ -436,7 +413,6 @@ describe('node constants', () => {
436413
it('should handle all flag getters being called multiple times', () => {
437414
// Call each getter multiple times to ensure caching works
438415
for (let i = 0; i < 3; i++) {
439-
getNodeDebugFlags()
440416
getNodeHardenFlags()
441417
getNodePermissionFlags()
442418
getNodeNoWarningsFlags()
@@ -445,12 +421,10 @@ describe('node constants', () => {
445421
})
446422

447423
it('should verify all flag arrays are non-empty or conditionally empty', () => {
448-
const debugFlags = getNodeDebugFlags()
449424
const hardenFlags = getNodeHardenFlags()
450425
const noWarningsFlags = getNodeNoWarningsFlags()
451426
const sigusr1Flags = getNodeDisableSigusr1Flags()
452427

453-
expect(debugFlags.length).toBeGreaterThan(0)
454428
expect(hardenFlags.length).toBeGreaterThan(0)
455429
expect(noWarningsFlags.length).toBeGreaterThan(0)
456430
expect(sigusr1Flags.length).toBeGreaterThan(0)
@@ -505,7 +479,6 @@ describe('node constants', () => {
505479

506480
it('should verify flag contents are strings starting with --', () => {
507481
const allFlags = [
508-
...getNodeDebugFlags(),
509482
...getNodeHardenFlags(),
510483
...getNodePermissionFlags(),
511484
...getNodeNoWarningsFlags(),

0 commit comments

Comments
 (0)