diff --git a/lib/cluster.js b/lib/cluster.js index 34f27d0c120efc..228ad0dfe28c06 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -6,6 +6,7 @@ const dgram = require('dgram'); const fork = require('child_process').fork; const net = require('net'); const util = require('util'); +const internalUtil = require('internal/util'); const SCHED_NONE = 1; const SCHED_RR = 2; @@ -30,14 +31,14 @@ function Worker(options) { this.exitedAfterDisconnect = undefined; Object.defineProperty(this, 'suicide', { - get: function() { - // TODO: Print deprecation message. + get: internalUtil.deprecate(() => { return this.exitedAfterDisconnect; - }, - set: function(val) { - // TODO: Print deprecation message. + }, 'worker.suicide is deprecated. ' + + 'Please use worker.exitedAfterDisconnect.'), + set: internalUtil.deprecate((val) => { this.exitedAfterDisconnect = val; - }, + }, 'worker.suicide is deprecated. ' + + 'Please use worker.exitedAfterDisconnect.'), enumerable: true });