diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-03-15 14:22:43 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-21 20:15:33 +0100 |
commit | 6a9f0499688b7515f3156a1754583d7624b25989 (patch) | |
tree | d84151b10c31eb482efb618c09d6b3672fbc9461 /lib/buffer.js | |
parent | ab8bf26994677a5f0823b3810668f6cfa18374d9 (diff) | |
download | android-node-v8-6a9f0499688b7515f3156a1754583d7624b25989.tar.gz android-node-v8-6a9f0499688b7515f3156a1754583d7624b25989.tar.bz2 android-node-v8-6a9f0499688b7515f3156a1754583d7624b25989.zip |
tools,lib: forbid native Error constructors
This adds a rule that forbids the use of native Error constructors in
the `lib` directory. This is to encourage use of the `internal/errors`
mechanism. The rule is disabled for errors that are not created with
the `internal/errors` module but are still assigned an error code.
PR-URL: https://github.com/nodejs/node/pull/19373
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/buffer.js')
-rw-r--r-- | lib/buffer.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/buffer.js b/lib/buffer.js index b369d27a1e..c11762aa57 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1073,6 +1073,7 @@ if (process.binding('config').hasIntl) { return result; const code = icuErrName(result); + // eslint-disable-next-line no-restricted-syntax const err = new Error(`Unable to transcode Buffer [${code}]`); err.code = code; err.errno = result; |