summaryrefslogtreecommitdiff
path: root/lib/assert.js
diff options
context:
space:
mode:
authorWeijia Wang <starkwang@126.com>2019-03-18 19:31:07 +0800
committerWeijia Wang <381152119@qq.com>2019-03-21 21:38:02 +0800
commitc8d3a73c8b673792e315759b70cf4822b64b3e45 (patch)
tree39f35c7327e82964acf66f63c3e9d1c919c3382b /lib/assert.js
parent1935625df4f56bd77c57ec100a9222c77e9d440c (diff)
downloadnode-new-c8d3a73c8b673792e315759b70cf4822b64b3e45.tar.gz
lib: use Array#includes instead of Array#indexOf
PR-URL: https://github.com/nodejs/node/pull/26732 Refs: https://github.com/nodejs/node/issues/26568 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/assert.js')
-rw-r--r--lib/assert.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/assert.js b/lib/assert.js
index 94e9406393..e32cae3cff 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -284,7 +284,7 @@ function getErrMessage(message, fn) {
// Flush unfinished multi byte characters.
decoder.end();
// Always normalize indentation, otherwise the message could look weird.
- if (message.indexOf('\n') !== -1) {
+ if (message.includes('\n')) {
if (EOL === '\r\n') {
message = message.replace(/\r\n/g, '\n');
}