diff options
author | Rich Trott <rtrott@gmail.com> | 2022-02-02 21:57:11 -0800 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2022-02-05 12:58:30 +0000 |
commit | 78a2cd862426fbc137f9286b7bcedf415f960ef0 (patch) | |
tree | c21b3e2a79da88748e820a41c3327890e3e89012 /lib/events.js | |
parent | ee8c2bed8bcc13b44ccfca07dd94b773b3bc943d (diff) | |
download | node-new-78a2cd862426fbc137f9286b7bcedf415f960ef0.tar.gz |
lib: add comments to empty catch statements
PR-URL: https://github.com/nodejs/node/pull/41831
Refs: https://eslint.org/docs/rules/no-empty
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'lib/events.js')
-rw-r--r-- | lib/events.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/events.js b/lib/events.js index f722b17aec..759d528892 100644 --- a/lib/events.js +++ b/lib/events.js @@ -445,7 +445,9 @@ function enhanceStackTrace(err, own) { const { name } = this.constructor; if (name !== 'EventEmitter') ctorInfo = ` on ${name} instance`; - } catch {} + } catch { + // Continue regardless of error. + } const sep = `\nEmitted 'error' event${ctorInfo} at:\n`; const errStack = ArrayPrototypeSlice( @@ -493,7 +495,9 @@ EventEmitter.prototype.emit = function emit(type, ...args) { value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture), configurable: true }); - } catch {} + } catch { + // Continue regardless of error. + } // Note: The comments on the `throw` lines are intentional, they show // up in Node's output if this results in an unhandled exception. |