diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index eaaa5090f8502a..e1f416ea79d4f6 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2523,14 +2523,18 @@ Prefer [`response.socket`][] over [`response.connection`][] and ### DEP0134: process._tickCallback -Type: Documentation-only (supports [`--pending-deprecation`][]) +Type: Runtime The `process._tickCallback` property was never documented as -an officially supported API. +an officially supported API. Please use `process.runNextTicks` +instead. [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 18acd9d2b64774..636bbdd14ccd04 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -281,10 +281,13 @@ process.emitWarning = emitWarning; const { nextTick, runNextTicks } = setupTaskQueue(); process.nextTick = nextTick; // Used to emulate a tick manually in the JS land. - // A better name for this function would be `runNextTicks` but - // it has been exposed to the process object so we keep this legacy name - // TODO(joyeecheung): either remove it or make it public - process._tickCallback = runNextTicks; + process.runNextTicks = runNextTicks; + process._tickCallback = deprecate( + runNextTicks, + 'process._tickCallback is deprecated. ' + + 'Please use `process.runNextTicks` instead.', + 'DEP0134'); + const { getTimerCallbacks } = require('internal/timers'); const { setupTimers } = internalBinding('timers'); diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 174ffcd018fd31..cab2d47c8e3350 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -271,10 +271,6 @@ function initializeDeprecations() { process.binding = deprecate(process.binding, 'process.binding() is deprecated. ' + 'Please use public APIs instead.', 'DEP0111'); - - process._tickCallback = deprecate(process._tickCallback, - 'process._tickCallback() is deprecated', - 'DEP0134'); } // Create global.process and global.Buffer as getters so that we have a