From cb48b85e846ea740c50f14891374530d4234ccfc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 12 Mar 2019 11:09:48 -0700 Subject: [PATCH] report: remove unnecessary return in setters Barring shenanigans like Object.getOwnPropertyDescriptor(), return values from a setter function will always be inaccessible. Remove the `return` statements as they can be misleading, suggesting that the return value is accessible and perhaps used somewhere. --- lib/internal/process/report.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index ff4e72f54c9978..19820efa93ba02 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -34,14 +34,14 @@ const report = { }, set directory(dir) { validateString(dir, 'directory'); - return nr.setDirectory(dir); + nr.setDirectory(dir); }, get filename() { return nr.getFilename(); }, set filename(name) { validateString(name, 'filename'); - return nr.setFilename(name); + nr.setFilename(name); }, get signal() { return nr.getSignal(); @@ -51,7 +51,7 @@ const report = { convertToValidSignal(sig); // Validate that the signal is recognized. removeSignalHandler(); addSignalHandler(sig); - return nr.setSignal(sig); + nr.setSignal(sig); }, get reportOnFatalError() { return nr.shouldReportOnFatalError(); @@ -60,7 +60,7 @@ const report = { if (typeof trigger !== 'boolean') throw new ERR_INVALID_ARG_TYPE('trigger', 'boolean', trigger); - return nr.setReportOnFatalError(trigger); + nr.setReportOnFatalError(trigger); }, get reportOnSignal() { return nr.shouldReportOnSignal(); @@ -80,7 +80,7 @@ const report = { if (typeof trigger !== 'boolean') throw new ERR_INVALID_ARG_TYPE('trigger', 'boolean', trigger); - return nr.setReportOnUncaughtException(trigger); + nr.setReportOnUncaughtException(trigger); } };