Skip to content

Commit f804b00

Browse files
committed
process: make _getActiveRequests and _getActiveHandles public
These are made public because of the reasons mentioned here: nodejs#37261
1 parent c0e66e3 commit f804b00

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

lib/internal/bootstrap/node.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ const rawMethods = internalBinding('process_methods');
141141
process.dlopen = rawMethods.dlopen;
142142
process.uptime = rawMethods.uptime;
143143

144-
// TODO(joyeecheung): either remove them or make them public
145-
process._getActiveRequests = rawMethods._getActiveRequests;
146-
process._getActiveHandles = rawMethods._getActiveHandles;
144+
process.getActiveRequests = rawMethods.getActiveRequests;
145+
process.getActiveHandles = rawMethods.getActiveHandles;
147146

148147
// TODO(joyeecheung): remove these
149148
process.reallyExit = rawMethods.reallyExit;

test/parallel/test-process-getactivehandles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function clientConnected(client) {
3030

3131

3232
function checkAll() {
33-
const handles = process._getActiveHandles();
33+
const handles = process.getActiveHandles();
3434

3535
clients.forEach(function(item) {
3636
assert.ok(handles.includes(item));

test/parallel/test-process-getactiverequests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ const fs = require('fs');
77
for (let i = 0; i < 12; i++)
88
fs.open(__filename, 'r', common.mustCall());
99

10-
assert.strictEqual(process._getActiveRequests().length, 12);
10+
assert.strictEqual(process.getActiveRequests().length, 12);

test/pseudo-tty/ref_keeps_node_running.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ handle.readStart();
1414
handle.onread = () => {};
1515

1616
function isHandleActive(handle) {
17-
return process._getActiveHandles().some((active) => active === handle);
17+
return process.getActiveHandles().some((active) => active === handle);
1818
}
1919

2020
strictEqual(isHandleActive(handle), true, 'TTY handle not initially active');

test/pummel/test-net-connect-econnrefused.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ function pummel() {
5454

5555
function check() {
5656
setTimeout(common.mustCall(function() {
57-
assert.strictEqual(process._getActiveRequests().length, 0);
58-
const activeHandles = process._getActiveHandles();
57+
assert.strictEqual(process.getActiveRequests().length, 0);
58+
const activeHandles = process.getActiveHandles();
5959
assert.ok(activeHandles.every((val) => val.constructor.name !== 'Socket'));
6060
}), 0);
6161
}

0 commit comments

Comments
 (0)